Merge branch 'hugo-shipping-notice' into test
This commit is contained in:
commit
27e3d73cb1
85 files changed
+2886
-307
No files matched your search
@@ -2,12 +2,12 @@
|
||||
* app/router/routes/workspace.routes.ts
|
||||
* 工作台路由表:/workspace 布局壳 + 各业务子页面懒加载。
|
||||
* 依赖:vue-router;meta.title 存 i18n key(workspace.*),由 guards 解析为 document.title。
|
||||
* 逻辑:WorkspaceLayout 嵌套应用首页、知识库、排程、反馈等子页;合同付款旧地址重定向到 Chat Agent。
|
||||
* 立账凭证明细为 accounting-voucher-check/runs/:runId。
|
||||
* 逻辑:WorkspaceLayout 嵌套应用首页、知识库、排程、反馈等子页;合同付款、立账凭证旧地址重定向到 Chat Agent。
|
||||
*/
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
const contractPaymentChatRedirect = () => import('@/features/contract-payment/views/ContractPaymentChatRedirect.vue');
|
||||
const voucherCheckChatRedirect = () => import('@/features/voucher-check/views/VoucherCheckChatRedirect.vue');
|
||||
|
||||
export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
@@ -83,14 +83,14 @@ export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: 'accounting-voucher-check',
|
||||
name: 'workspace-accounting-voucher-check',
|
||||
component: () => import('@/features/workspace/pages/AccountingVoucherCheckPage.vue'),
|
||||
meta: { title: 'workspace.nav.accountingVoucherCheck', requiresAdmin: true },
|
||||
component: voucherCheckChatRedirect,
|
||||
meta: { title: 'workspace.nav.accountingVoucherCheck' },
|
||||
},
|
||||
{
|
||||
path: 'accounting-voucher-check/runs/:runId',
|
||||
name: 'workspace-accounting-voucher-check-detail',
|
||||
component: () => import('@/features/workspace/pages/AccountingVoucherCheckDetailPage.vue'),
|
||||
meta: { title: 'workspace.voucherCheck.detailTitle', requiresAdmin: true },
|
||||
component: voucherCheckChatRedirect,
|
||||
meta: { title: 'workspace.voucherCheck.detailTitle' },
|
||||
},
|
||||
{
|
||||
path: 'contract-payment',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/chat/components/ChatMobileHeader.vue
|
||||
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。合同付款预警可隐藏历史入口。
|
||||
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。作业面 Agent 可隐藏历史入口。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* 依赖:lucide-vue-next、LocaleToggleButton、ExternalSystemLinks、AgentCategoryList、chat.types。
|
||||
* 逻辑:由聊天页面传入当前 Agent、历史记录与用户可用 Agent;通过事件把新会话、切换 Agent、反馈、进入管理控制台等操作回传给页面。
|
||||
* 管理员通过底部右侧工具图标进入管理控制台;用户下拉菜单仅保留退出登录。
|
||||
* 合同付款预警第一期不走对话,hideSessionUi 时隐藏新会话与历史列表。
|
||||
* 合同付款预警、立账凭证第一期不走对话,hideSessionUi 时隐藏新会话与历史列表。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
@@ -205,7 +205,7 @@ const orderExtractionAttentionClass = (item: DisplayHistoryItem) => {
|
||||
</button>
|
||||
</div>
|
||||
<p v-else class="px-4 pb-3 text-xs leading-5 text-muted">
|
||||
{{ $t('admin.contractPayment.sessionHint') }}
|
||||
{{ $t('chat.taskAgent.sessionHint') }}
|
||||
</p>
|
||||
|
||||
<div v-if="!hideSessionUi" class="flex items-center justify-between px-4 py-2">
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
* 用途:对话页主区域,组合侧栏、消息列表、输入栏、货代会话 Workflow 时间线与内置浏览器。
|
||||
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、ContractPaymentChatPanel、chat.context。
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、ContractPaymentChatPanel、VoucherCheckChatPanel、chat.context。
|
||||
|
||||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
|
||||
* 货代会话主区域:有会话即全屏批次进度中心(常驻),无会话为欢迎页+输入框;会话标题取自侧栏历史并传给中心;
|
||||
* 右侧「本次处理」由 conversationId 驱动 Workflow projection,extractionRunNo 仅作进度装饰;
|
||||
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警 Agent 用 Tab 台账替换消息列表与输入框。
|
||||
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警、立账凭证 Agent 用 Tab 作业面替换消息列表与输入框。
|
||||
|
||||
*/
|
||||
|
||||
@@ -47,7 +47,7 @@ import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||||
|
||||
import { matchesTrainingAgent } from '@/features/chat/training/trainingWorkspace.utils';
|
||||
|
||||
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER, isContractPaymentAgent } from '@/shared/utils/agent-registry.utils';
|
||||
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER, isContractPaymentAgent, isVoucherCheckAgent } from '@/shared/utils/agent-registry.utils';
|
||||
|
||||
import {
|
||||
SHIPPING_WORKFLOW_KEY,
|
||||
@@ -77,6 +77,10 @@ const ContractPaymentChatPanel = defineAsyncComponent(
|
||||
() => import('@/features/contract-payment/components/ContractPaymentChatPanel.vue'),
|
||||
);
|
||||
|
||||
const VoucherCheckChatPanel = defineAsyncComponent(
|
||||
() => import('@/features/voucher-check/components/VoucherCheckChatPanel.vue'),
|
||||
);
|
||||
|
||||
type MaintenanceRecordPanelCommand = {
|
||||
|
||||
mode: 'list' | 'create';
|
||||
@@ -124,6 +128,12 @@ const isInTransitTransferAgent = computed(() => resolveAgentCode(page.currentAge
|
||||
/** 合同付款预警 Agent:主区嵌台账 Tab,隐藏对话输入与历史。 */
|
||||
const isContractPaymentAgentPage = computed(() => isContractPaymentAgent(page.currentAgent));
|
||||
|
||||
/** 立账凭证 Agent:主区嵌检核任务 / 企微发送记录 Tab,隐藏对话输入与历史。 */
|
||||
const isVoucherCheckAgentPage = computed(() => isVoucherCheckAgent(page.currentAgent));
|
||||
|
||||
/** builtin 作业面 Agent 共用:隐藏新会话、历史列表与输入框。 */
|
||||
const hideTaskChatSessionUi = computed(() => isContractPaymentAgentPage.value || isVoucherCheckAgentPage.value);
|
||||
|
||||
/** 在途仓自动调拨业务流激活(来源选择/待处理等子视图)时隐藏聊天输入框,模拟业务页。 */
|
||||
const transferFlowActive = ref(false);
|
||||
watch(isInTransitTransferAgent, (isTransfer) => { if (!isTransfer) transferFlowActive.value = false; });
|
||||
@@ -382,7 +392,7 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
:applied-theme="page.appliedTheme"
|
||||
|
||||
:hide-session-ui="isContractPaymentAgentPage"
|
||||
:hide-session-ui="hideTaskChatSessionUi"
|
||||
|
||||
@new-chat="page.handleSidebarNewChat"
|
||||
|
||||
@@ -424,7 +434,7 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
:user-agents="page.userAgents"
|
||||
|
||||
:hide-history="isContractPaymentAgentPage"
|
||||
:hide-history="hideTaskChatSessionUi"
|
||||
|
||||
@open-guide="page.openGuideModal"
|
||||
|
||||
@@ -470,6 +480,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
<ContractPaymentChatPanel v-else-if="isContractPaymentAgentPage" />
|
||||
|
||||
<VoucherCheckChatPanel v-else-if="isVoucherCheckAgentPage" />
|
||||
|
||||
<div v-else class="flex min-h-0 min-w-0 flex-1">
|
||||
|
||||
<!-- 中心展示时对话列整体隐藏(含输入框),新文件提交走新建对话(spec 方案 A 硬性决策)。 -->
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface AlertSummary { pending_count: number; next_send_at?: string | n
|
||||
|
||||
/**
|
||||
* 分页查询合同付款台账或待确认合同。
|
||||
* 核心逻辑:keyword 同时匹配合同号、流程号、采购单号和供应商;reviewOnly 走待确认列表。
|
||||
* 核心逻辑:keyword 同时匹配合同号、流程号、采购单号、供应商和申请人;reviewOnly 走待确认列表。
|
||||
* @param params.keyword - 模糊检索词,可为空。
|
||||
* @param params.parse_status - 解析状态精确筛选。
|
||||
* @param params.reviewOnly - 为 true 时只查 needs_review。
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
features/contract-payment/views/ContractPaymentPage.vue
|
||||
用途:合同付款预警台账列表、汇总卡与本周待发送摘要。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:Chat Tab 以 embedded 嵌入时隐藏页头;点行通过 open-detail 交给父级下钻详情。
|
||||
逻辑:Chat Tab 以 embedded 嵌入时隐藏页头;点行通过 open-detail 交给父级下钻详情;关键词可搜合同号、流程号、采购单号、供应商和申请人。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
@@ -147,7 +147,7 @@ async function refreshLedgerSummary(): Promise<void> {
|
||||
}
|
||||
/**
|
||||
* 加载当前页合同台账。
|
||||
* 核心逻辑:合同列表使用服务端分页;关键词同时匹配合同号、流程号、采购单号和供应商;
|
||||
* 核心逻辑:合同列表使用服务端分页;关键词同时匹配合同号、流程号、采购单号、供应商和申请人;
|
||||
* 汇总卡 focus 与关键词叠加;搜索、点卡片和每页条数变化均从第一页开始,并并行刷新待发送摘要与汇总卡。
|
||||
* @param resetPage - 为 true 时重置为第一页,用于关键词查询或切换汇总卡。
|
||||
* @returns 完成后更新当前列表、分页元数据、待发送摘要和汇总卡。
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
features/contract-payment/views/ContractPaymentReviewPage.vue
|
||||
用途:集中展示关键解析事实缺失或冲突的合同,供管理员下载原文并人工确认。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;Chat 父级通过 open-detail 下钻详情。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;关键词可搜合同号、采购单号、供应商和申请人;Chat 父级通过 open-detail 下钻详情。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
@@ -32,7 +32,7 @@ const pages = ref(1);
|
||||
|
||||
/**
|
||||
* 读取需要人工确认的合同列表。
|
||||
* 核心逻辑:明确传入 reviewOnly,避免前端仅按显示状态过滤而遗漏后端新产生的待确认合同;关键词同样匹配供应商。
|
||||
* 核心逻辑:明确传入 reviewOnly,避免前端仅按显示状态过滤而遗漏后端新产生的待确认合同;关键词同样匹配供应商和申请人。
|
||||
* @param resetPage - 为 true 时重置到第一页,供关键词查询使用。
|
||||
* @returns 请求完成后更新分页数据;失败时保留已有列表并提示原因。
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
<!--
|
||||
features/voucher-check/components/VoucherCheckChatPanel.vue
|
||||
用途:立账凭证 Chat 主区:检核任务 / 企微发送记录 / 通知配置 Tab,当前 Tab 内批次明细下钻。
|
||||
依赖:workspace 立账凭证列表与详情、VoucherCheckNotifyConfigPanel、voucherCheckChat.utils、vue-router query、auth.store。
|
||||
逻辑:由 ChatViewContent 在 agent_code=voucher_check 时替换消息列表与输入框;
|
||||
view / runId / runNo 写入 /chat/:agentId 查询参数;通知配置仅平台管理员可见可改。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import AccountingVoucherCheckDetailView from '@/features/workspace/views/AccountingVoucherCheckDetailView.vue';
|
||||
import AccountingVoucherCheckView from '@/features/workspace/views/AccountingVoucherCheckView.vue';
|
||||
import type { VoucherCheckChatView } from '../constants';
|
||||
import {
|
||||
buildVoucherCheckChatQuery,
|
||||
parseVoucherCheckChatQuery,
|
||||
} from '../utils/voucherCheckChat.utils';
|
||||
import VoucherCheckNotifyConfigPanel from './VoucherCheckNotifyConfigPanel.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
|
||||
const isAdmin = computed(() => Boolean(auth.isAdmin));
|
||||
const parsedQuery = computed(() => parseVoucherCheckChatQuery(
|
||||
route.query.view,
|
||||
route.query.runId,
|
||||
route.query.runNo,
|
||||
));
|
||||
const activeView = computed<VoucherCheckChatView>(() => parsedQuery.value.view);
|
||||
const detailRunId = computed(() => parsedQuery.value.runId);
|
||||
const detailRunNo = computed(() => parsedQuery.value.runNo);
|
||||
|
||||
const tabs = computed(() => {
|
||||
const items: Array<{ key: VoucherCheckChatView; label: string }> = [
|
||||
{ key: 'tasks', label: t('workspace.voucherCheck.tabTasks') },
|
||||
{ key: 'notifications', label: t('workspace.voucherCheck.tabNotifications') },
|
||||
];
|
||||
if (isAdmin.value) {
|
||||
items.push({ key: 'notifyConfig', label: t('workspace.voucherCheck.tabNotifyConfig') });
|
||||
}
|
||||
return items;
|
||||
});
|
||||
|
||||
/**
|
||||
* 把当前 Tab / 批次明细写入 Chat 路由,保持刷新与旧地址重定向可用。
|
||||
* 核心逻辑:replace 避免 Tab 切换堆积历史;切 Tab 时清掉 runId。
|
||||
*/
|
||||
async function syncQuery(
|
||||
view: VoucherCheckChatView,
|
||||
runId: number | null,
|
||||
runNo: string | null = null,
|
||||
): Promise<void> {
|
||||
const nextQuery = buildVoucherCheckChatQuery(view, runId, runNo);
|
||||
const currentView = String(route.query.view || '');
|
||||
const currentRunId = String(route.query.runId || '');
|
||||
const currentRunNo = String(route.query.runNo || '');
|
||||
if (
|
||||
currentView === nextQuery.view
|
||||
&& currentRunId === (nextQuery.runId || '')
|
||||
&& currentRunNo === (nextQuery.runNo || '')
|
||||
) return;
|
||||
const query = { ...route.query, ...nextQuery };
|
||||
if (!runId) {
|
||||
delete query.runId;
|
||||
delete query.runNo;
|
||||
}
|
||||
await router.replace({ params: { ...route.params }, query });
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换主 Tab;详情下钻随 Tab 关闭,避免第四个隐形页。
|
||||
*/
|
||||
function selectView(view: VoucherCheckChatView): void {
|
||||
void syncQuery(view, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在当前 Tab 内打开批次明细。
|
||||
*/
|
||||
function openDetail(payload: { runId: number; runNo?: string | null }): void {
|
||||
void syncQuery(activeView.value, payload.runId, payload.runNo || null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从明细返回当前 Tab 列表。
|
||||
*/
|
||||
function closeDetail(): void {
|
||||
void syncQuery(activeView.value, null);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => route.query.view,
|
||||
(rawView) => {
|
||||
if (rawView) return;
|
||||
void syncQuery(activeView.value, detailRunId.value, detailRunNo.value);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
[isAdmin, activeView],
|
||||
() => {
|
||||
if (!isAdmin.value && activeView.value === 'notifyConfig') {
|
||||
void syncQuery('tasks', null);
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[var(--surface-muted,#f4f7fb)]">
|
||||
<div class="px-5 pt-5">
|
||||
<h1 class="text-xl font-bold text-primary">{{ t('workspace.voucherCheck.title') }}</h1>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('workspace.voucherCheck.subtitle') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex gap-0 border-b border-default px-5">
|
||||
<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="activeView === tab.key
|
||||
? 'border-brand-500 text-brand-600'
|
||||
: 'border-transparent text-muted hover:text-secondary'"
|
||||
@click="selectView(tab.key)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="min-h-0 flex-1 overflow-auto px-5 py-4">
|
||||
<VoucherCheckNotifyConfigPanel v-if="activeView === 'notifyConfig' && isAdmin" />
|
||||
<AccountingVoucherCheckDetailView
|
||||
v-else-if="detailRunId"
|
||||
:run-id="detailRunId"
|
||||
:run-no="detailRunNo"
|
||||
embedded
|
||||
@close="closeDetail"
|
||||
/>
|
||||
<AccountingVoucherCheckView
|
||||
v-else
|
||||
:active-tab="activeView === 'notifications' ? 'notifications' : 'tasks'"
|
||||
embedded
|
||||
@open-detail="openDetail"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,201 @@
|
||||
<!--
|
||||
features/voucher-check/components/VoucherCheckNotifyConfigPanel.vue
|
||||
用途:立账凭证 Chat「通知配置」Tab:按六类必检文件分别选择企微接收人。
|
||||
依赖:voucherCheck.api、UserPickerDialog、vue-i18n、useMessage。
|
||||
逻辑:仅平台管理员可见;规则来自销售 Profile,接收人写入独立配置表;
|
||||
行内只展示标签 +「选择」,点选打开公共选人弹窗;未绑企微的人可勾选但发送时会被跳过。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Loader2 } from 'lucide-vue-next';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import UserPickerDialog from '@/shared/components/UserPickerDialog.vue';
|
||||
import { userPickerLabel } from '@/shared/utils/userPicker.utils';
|
||||
import {
|
||||
getVoucherCheckNotifyConfig,
|
||||
saveVoucherCheckNotifyConfig,
|
||||
type VoucherCheckNotifyRule,
|
||||
type VoucherCheckNotifyUser,
|
||||
} from '@/features/workspace/api/voucherCheck.api';
|
||||
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
const profileCode = ref('sales');
|
||||
const rules = ref<VoucherCheckNotifyRule[]>([]);
|
||||
const users = ref<VoucherCheckNotifyUser[]>([]);
|
||||
const updatedAt = ref<string | null>(null);
|
||||
const pickerOpen = ref(false);
|
||||
const pickerRuleCode = ref<string | null>(null);
|
||||
|
||||
const userMap = computed(() => {
|
||||
const next = new Map<number, VoucherCheckNotifyUser>();
|
||||
for (const user of users.value) next.set(user.id, user);
|
||||
return next;
|
||||
});
|
||||
|
||||
const pickerRule = computed(() =>
|
||||
rules.value.find((rule) => rule.code === pickerRuleCode.value) || null,
|
||||
);
|
||||
|
||||
const pickerSelectedIds = computed(() => pickerRule.value?.user_ids || []);
|
||||
|
||||
/**
|
||||
* 打开某文件类型的公共选人弹窗。
|
||||
*/
|
||||
function openPicker(ruleCode: string): void {
|
||||
pickerRuleCode.value = ruleCode;
|
||||
pickerOpen.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹窗确定后写回该行接收人。
|
||||
*/
|
||||
function applyPickerSelection(userIds: number[]): void {
|
||||
const row = rules.value.find((rule) => rule.code === pickerRuleCode.value);
|
||||
if (row) row.user_ids = [...userIds];
|
||||
pickerRuleCode.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从行内标签移除接收人,不必打开弹窗。
|
||||
*/
|
||||
function removeUser(ruleCode: string, userId: number): void {
|
||||
const row = rules.value.find((rule) => rule.code === ruleCode);
|
||||
if (!row) return;
|
||||
row.user_ids = row.user_ids.filter((id) => id !== userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载六行规则与候选人。
|
||||
*/
|
||||
async function loadConfig(): Promise<void> {
|
||||
loading.value = true;
|
||||
try {
|
||||
const data = await getVoucherCheckNotifyConfig(profileCode.value);
|
||||
profileCode.value = data.profile_code || 'sales';
|
||||
rules.value = (data.rules || []).map((rule) => ({
|
||||
...rule,
|
||||
user_ids: Array.isArray(rule.user_ids) ? [...rule.user_ids] : [],
|
||||
}));
|
||||
users.value = data.users || [];
|
||||
updatedAt.value = data.updated_at || null;
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || t('workspace.voucherCheck.notifyConfigLoadFailed'));
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前六行选人结果。
|
||||
*/
|
||||
async function saveConfig(): Promise<void> {
|
||||
saving.value = true;
|
||||
try {
|
||||
const recipients: Record<string, number[]> = {};
|
||||
for (const rule of rules.value) recipients[rule.code] = [...rule.user_ids];
|
||||
const data = await saveVoucherCheckNotifyConfig({
|
||||
profile_code: profileCode.value,
|
||||
recipients,
|
||||
});
|
||||
rules.value = (data.rules || []).map((rule) => ({
|
||||
...rule,
|
||||
user_ids: Array.isArray(rule.user_ids) ? [...rule.user_ids] : [],
|
||||
}));
|
||||
users.value = data.users || [];
|
||||
updatedAt.value = data.updated_at || null;
|
||||
msg.success(t('workspace.voucherCheck.notifyConfigSaved'));
|
||||
} catch (error: any) {
|
||||
msg.error(error?.message || t('workspace.voucherCheck.notifyConfigSaveFailed'));
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadConfig();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<article class="overflow-hidden rounded-2xl border border-default bg-surface">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3 border-b border-default px-4 py-3">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold text-primary">{{ t('workspace.voucherCheck.notifyConfigTitle') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('workspace.voucherCheck.notifyConfigSubtitle') }}</p>
|
||||
<p v-if="updatedAt" class="mt-1 text-xs text-muted">
|
||||
{{ t('workspace.voucherCheck.notifyConfigUpdatedAt', { time: updatedAt }) }}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-xl bg-brand-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-brand-700 disabled:opacity-50"
|
||||
:disabled="loading || saving"
|
||||
@click="saveConfig"
|
||||
>
|
||||
<Loader2 v-if="saving" class="h-3.5 w-3.5 animate-spin" />
|
||||
{{ t('workspace.voucherCheck.notifyConfigSave') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="flex items-center justify-center gap-2 px-4 py-10 text-sm text-muted">
|
||||
<Loader2 class="h-4 w-4 animate-spin" />
|
||||
{{ t('workspace.voucherCheck.loading') }}
|
||||
</div>
|
||||
|
||||
<div v-else class="divide-y divide-default">
|
||||
<div
|
||||
v-for="rule in rules"
|
||||
:key="rule.code"
|
||||
class="grid gap-3 px-4 py-3 md:grid-cols-[220px_minmax(0,1fr)] md:items-center"
|
||||
>
|
||||
<div>
|
||||
<p class="text-sm font-semibold text-primary">{{ rule.name }}</p>
|
||||
<p class="mt-0.5 text-xs text-muted">
|
||||
{{ t('workspace.voucherCheck.notifyConfigFolder', { folder: rule.type_folder || '—' }) }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="inline-flex w-fit min-w-[18rem] max-w-full flex-wrap items-center gap-1.5 rounded-xl border border-default bg-surface px-2 py-1.5">
|
||||
<span
|
||||
v-for="userId in rule.user_ids"
|
||||
:key="userId"
|
||||
class="inline-flex items-center gap-1 rounded-lg bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700"
|
||||
>
|
||||
{{ userPickerLabel(userMap.get(userId), userId) }}
|
||||
<span
|
||||
v-if="userMap.get(userId) && !userMap.get(userId)?.wecom_bound"
|
||||
class="text-amber-600"
|
||||
>!</span>
|
||||
<button
|
||||
type="button"
|
||||
class="ml-0.5 text-blue-400 hover:text-blue-600"
|
||||
@click="removeUser(rule.code, userId)"
|
||||
>✕</button>
|
||||
</span>
|
||||
<span v-if="rule.user_ids.length === 0" class="text-sm text-muted">
|
||||
{{ t('workspace.voucherCheck.notifyConfigEmptyUsers') }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="ml-auto shrink-0 rounded-lg border border-blue-200 bg-blue-50 px-2.5 py-1 text-xs font-semibold text-brand-600 hover:bg-blue-100"
|
||||
@click="openPicker(rule.code)"
|
||||
>
|
||||
{{ t('common.userPicker.select') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UserPickerDialog
|
||||
v-model="pickerOpen"
|
||||
:users="users"
|
||||
:selected-ids="pickerSelectedIds"
|
||||
:title="t('workspace.voucherCheck.notifyConfigPickerTitle')"
|
||||
@confirm="applyPickerSelection"
|
||||
/>
|
||||
</article>
|
||||
</template>
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* features/voucher-check/constants.ts
|
||||
* 用途:立账凭证 Chat Tab 与深链约定。
|
||||
* 依赖:无。
|
||||
* 逻辑:Chat 主区 Tab 与旧工作台重定向共用 view;详情用 runId,可选 runNo 仅作标题展示。
|
||||
* notifyConfig 仅管理员可见,解析仍接受该值以便深链打开后由面板做权限回退。
|
||||
*/
|
||||
export const VOUCHER_CHECK_CHAT_VIEWS = ['tasks', 'notifications', 'notifyConfig'] as const;
|
||||
|
||||
export type VoucherCheckChatView = (typeof VOUCHER_CHECK_CHAT_VIEWS)[number];
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* features/voucher-check/utils/voucherCheckChat.utils.test.ts
|
||||
* 用途:锁定立账凭证 Chat 深链 query 的解析与回写规则。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
buildVoucherCheckChatQuery,
|
||||
parseVoucherCheckChatQuery,
|
||||
} from './voucherCheckChat.utils';
|
||||
|
||||
describe('parseVoucherCheckChatQuery', () => {
|
||||
it('accepts tasks / notifications / notifyConfig and a positive runId', () => {
|
||||
expect(parseVoucherCheckChatQuery('notifications', '12', 'VC-202608-001')).toEqual({
|
||||
view: 'notifications',
|
||||
runId: 12,
|
||||
runNo: 'VC-202608-001',
|
||||
});
|
||||
expect(parseVoucherCheckChatQuery('notifyConfig', null, null)).toEqual({
|
||||
view: 'notifyConfig',
|
||||
runId: null,
|
||||
runNo: null,
|
||||
});
|
||||
});
|
||||
|
||||
it('falls back to tasks for unknown view and ignores invalid runId', () => {
|
||||
expect(parseVoucherCheckChatQuery('unknown', 'abc', ' ')).toEqual({
|
||||
view: 'tasks',
|
||||
runId: null,
|
||||
runNo: null,
|
||||
});
|
||||
expect(parseVoucherCheckChatQuery(undefined, '0', undefined)).toEqual({
|
||||
view: 'tasks',
|
||||
runId: null,
|
||||
runNo: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildVoucherCheckChatQuery', () => {
|
||||
it('always writes view and omits runId on list pages', () => {
|
||||
expect(buildVoucherCheckChatQuery('notifications', null)).toEqual({ view: 'notifications' });
|
||||
});
|
||||
|
||||
it('keeps the current tab when drilling into a run', () => {
|
||||
expect(buildVoucherCheckChatQuery('notifications', 9, 'VC-9')).toEqual({
|
||||
view: 'notifications',
|
||||
runId: '9',
|
||||
runNo: 'VC-9',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* features/voucher-check/utils/voucherCheckChat.utils.ts
|
||||
* 用途:解析立账凭证 Chat 的 view / runId / runNo 查询参数。
|
||||
* 依赖:voucher-check/constants。
|
||||
* 逻辑:旧工作台重定向与 Chat Tab 共用;非法 view 回退检核任务。notifyConfig 为管理员通知配置页。
|
||||
*/
|
||||
import { VOUCHER_CHECK_CHAT_VIEWS, type VoucherCheckChatView } from '../constants';
|
||||
|
||||
export interface VoucherCheckChatQuery {
|
||||
view: VoucherCheckChatView;
|
||||
runId: number | null;
|
||||
runNo: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把路由 query 归一成立账凭证 Chat 视图。
|
||||
* 核心逻辑:只接受 tasks / notifications / notifyConfig;runId 必须是正整数才进入批次明细;runNo 仅展示。
|
||||
* @param rawView - 路由 query.view
|
||||
* @param rawRunId - 路由 query.runId
|
||||
* @param rawRunNo - 路由 query.runNo
|
||||
*/
|
||||
export function parseVoucherCheckChatQuery(
|
||||
rawView: unknown,
|
||||
rawRunId: unknown,
|
||||
rawRunNo: unknown,
|
||||
): VoucherCheckChatQuery {
|
||||
const view = VOUCHER_CHECK_CHAT_VIEWS.includes(String(rawView) as VoucherCheckChatView)
|
||||
? String(rawView) as VoucherCheckChatView
|
||||
: 'tasks';
|
||||
const parsed = Number(rawRunId);
|
||||
const runId = Number.isInteger(parsed) && parsed > 0 ? parsed : null;
|
||||
const runNo = typeof rawRunNo === 'string' && rawRunNo.trim() ? rawRunNo.trim() : null;
|
||||
return { view, runId, runNo };
|
||||
}
|
||||
|
||||
/**
|
||||
* 把立账凭证视图写回 Chat 路由 query,便于刷新与旧工作台重定向共用同一深链。
|
||||
* 核心逻辑:始终带 view;仅在下钻明细时带 runId / runNo,避免空 query 污染地址栏。
|
||||
* @param view - 当前 Tab
|
||||
* @param runId - 明细批次排程 ID;列表态传 null
|
||||
* @param runNo - 批次号,仅详情标题使用
|
||||
*/
|
||||
export function buildVoucherCheckChatQuery(
|
||||
view: VoucherCheckChatView,
|
||||
runId: number | null,
|
||||
runNo: string | null = null,
|
||||
): Record<string, string> {
|
||||
const query: Record<string, string> = { view };
|
||||
if (runId) query.runId = String(runId);
|
||||
if (runId && runNo) query.runNo = runNo;
|
||||
return query;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<!--
|
||||
features/voucher-check/views/VoucherCheckChatRedirect.vue
|
||||
用途:把旧工作台立账凭证 URL 转到对应 Chat Agent 深链。
|
||||
依赖:listUserAgents、isVoucherCheckAgent、voucherCheckChat.utils。
|
||||
逻辑:按路径还原 view / runId / runNo,再在当前用户 Agent 列表中定位 voucher_check;
|
||||
未授权时提示并回应用管理。本页不渲染业务 UI。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { listUserAgents } from '@/features/auth/api/user.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { isVoucherCheckAgent } from '@/shared/utils/agent-registry.utils';
|
||||
import { WORKSPACE_PATHS } from '@/features/workspace/constants/routes';
|
||||
import type { VoucherCheckChatView } from '../constants';
|
||||
import { buildVoucherCheckChatQuery } from '../utils/voucherCheckChat.utils';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
|
||||
/**
|
||||
* 从旧工作台路径还原 Chat Tab 与批次明细。
|
||||
* 核心逻辑:runs/:runId 进入当前 Tab 下钻;?run_id= 兼容旧列表深链;?view=notifications 打开发送记录。
|
||||
*/
|
||||
function resolveLegacyTarget(): {
|
||||
view: VoucherCheckChatView;
|
||||
runId: number | null;
|
||||
runNo: string | null;
|
||||
} {
|
||||
const path = String(route.path || '');
|
||||
const view: VoucherCheckChatView = String(route.query.view || '') === 'notifications'
|
||||
? 'notifications'
|
||||
: 'tasks';
|
||||
const runNo = typeof route.query.runNo === 'string' && route.query.runNo.trim()
|
||||
? route.query.runNo.trim()
|
||||
: null;
|
||||
const detailMatch = path.match(/\/accounting-voucher-check\/runs\/(\d+)/);
|
||||
if (detailMatch) {
|
||||
return { view, runId: Number(detailMatch[1]), runNo };
|
||||
}
|
||||
const queryRunId = Number(Array.isArray(route.query.run_id) ? route.query.run_id[0] : route.query.run_id);
|
||||
if (Number.isInteger(queryRunId) && queryRunId > 0) {
|
||||
return { view, runId: queryRunId, runNo };
|
||||
}
|
||||
return { view, runId: null, runNo: null };
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找当前用户可用的立账凭证 Agent 并跳转 Chat。
|
||||
* 核心逻辑:admin 与已授权用户都能在 /api/agents 看到该 Agent;找不到则视为无权限。
|
||||
*/
|
||||
async function redirectToChat(): Promise<void> {
|
||||
const { view, runId, runNo } = resolveLegacyTarget();
|
||||
try {
|
||||
const agents = await listUserAgents();
|
||||
const agent = Array.isArray(agents) ? agents.find((item) => isVoucherCheckAgent(item)) : null;
|
||||
const agentId = Number(agent?.id);
|
||||
if (!Number.isInteger(agentId) || agentId <= 0) {
|
||||
msg.warning(t('errors.codes.VOUCHER_CHECK_FORBIDDEN'));
|
||||
await router.replace(WORKSPACE_PATHS.applications);
|
||||
return;
|
||||
}
|
||||
await router.replace({
|
||||
path: `/chat/${agentId}`,
|
||||
query: buildVoucherCheckChatQuery(view, runId, runNo),
|
||||
});
|
||||
} catch {
|
||||
msg.warning(t('errors.codes.VOUCHER_CHECK_FORBIDDEN'));
|
||||
await router.replace(WORKSPACE_PATHS.applications);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void redirectToChat();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex min-h-[40vh] items-center justify-center text-sm text-muted">
|
||||
{{ t('chat.loadingAgent') }}
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* features/workspace/api/voucherCheck.api.ts
|
||||
* 用途:工作台立账凭证检核任务列表、最近一次检核、批次明细、企微发送记录与强制重检 API 客户端。
|
||||
* 用途:工作台立账凭证检核任务列表、最近一次检核、批次明细、企微发送记录、通知配置与强制重检 API 客户端。
|
||||
* 依赖:@/shared/api/client、getAuthHeaders。
|
||||
* 逻辑:AccountingVoucherCheckView / DetailView 调用;对应 /api/workspace/accounting-voucher-check/* 与排程 Excel 下载。
|
||||
* 逻辑:AccountingVoucherCheckView / DetailView / VoucherCheckNotifyConfigPanel 调用;
|
||||
* 对应 /api/workspace/accounting-voucher-check/* 与排程 Excel 下载。
|
||||
*/
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
@@ -222,6 +223,60 @@ export async function downloadVoucherCheckExcel(scheduleRunId: number, filename?
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
export interface VoucherCheckNotifyUser {
|
||||
id: number;
|
||||
username: string;
|
||||
real_name?: string | null;
|
||||
employee_id?: string | null;
|
||||
department?: string | null;
|
||||
wecom_bound: boolean;
|
||||
}
|
||||
|
||||
export interface VoucherCheckNotifyRule {
|
||||
code: string;
|
||||
name: string;
|
||||
type_folder: string;
|
||||
user_ids: number[];
|
||||
}
|
||||
|
||||
export interface VoucherCheckNotifyConfig {
|
||||
profile_code: string;
|
||||
rules: VoucherCheckNotifyRule[];
|
||||
users: VoucherCheckNotifyUser[];
|
||||
updated_at?: string | null;
|
||||
updated_by?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取按文件类型的企微接收人(仅平台管理员)。
|
||||
*/
|
||||
export function getVoucherCheckNotifyConfig(profileCode?: string) {
|
||||
const q = new URLSearchParams();
|
||||
if (profileCode) q.set('profile_code', profileCode);
|
||||
const qs = q.toString();
|
||||
return requestJson<VoucherCheckNotifyConfig>(
|
||||
`/api/workspace/accounting-voucher-check/notify-config${qs ? `?${qs}` : ''}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存按文件类型的企微接收人(仅平台管理员)。
|
||||
*/
|
||||
export function saveVoucherCheckNotifyConfig(payload: {
|
||||
profile_code?: string;
|
||||
recipients: Record<string, number[]>;
|
||||
}) {
|
||||
return requestJson<VoucherCheckNotifyConfig>(
|
||||
'/api/workspace/accounting-voucher-check/notify-config',
|
||||
{
|
||||
method: 'PUT',
|
||||
headers: { ...getAuthHeaders(), 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制重检上一个自然月(不走增量跳过)。
|
||||
*/
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* features/workspace/components/WorkspaceSidebar.vue
|
||||
* 工作台左侧导航:子路由链接、货代二级菜单、关联服务入口、返回聊天与退出登录。
|
||||
* 依赖:WORKSPACE_PATHS、workspace.context、ExternalSystemLinks。
|
||||
* 逻辑:底部关联服务复用 ws-nav-btn,与返回聊天/退出登录对齐。合同付款已迁入 Chat Agent,不再在此展示。
|
||||
* 逻辑:底部关联服务复用 ws-nav-btn,与返回聊天/退出登录对齐。合同付款、立账凭证已迁入 Chat Agent,不再在此展示。
|
||||
* 矮屏时中间导航独立滚动,底部返回聊天/退出登录始终留在视口内。
|
||||
*/
|
||||
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen, ClipboardCheck,
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen,
|
||||
ChevronDown, ChevronRight, ContactRound, Inbox, FileDown,
|
||||
} from 'lucide-vue-next';
|
||||
import { WORKSPACE_PATHS } from '../constants/routes';
|
||||
@@ -36,7 +36,6 @@ const primaryLinkItems = [
|
||||
] as const;
|
||||
|
||||
const secondaryLinkItems = [
|
||||
{ path: WORKSPACE_PATHS.accountingVoucherCheck, labelKey: 'workspace.nav.accountingVoucherCheck', icon: ClipboardCheck, match: ['workspace-accounting-voucher-check', 'workspace-accounting-voucher-check-detail'] },
|
||||
{ path: WORKSPACE_PATHS.feedback, labelKey: 'workspace.nav.feedback', icon: Edit, match: ['workspace-feedback'] },
|
||||
{ path: WORKSPACE_PATHS.updates, labelKey: 'workspace.nav.updates', icon: Megaphone, match: ['workspace-updates'] },
|
||||
] as const;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* features/workspace/constants/routes.ts
|
||||
* 工作台子路由 path 常量,以及旧 ?view= 查询参数到新 path 的映射。
|
||||
* 立账凭证批次明细:accountingVoucherCheckDetail(scheduleRunId)。
|
||||
* 立账凭证路径仍保留,供旧书签落到 Chat 重定向页。
|
||||
* 合同付款路径仍保留,供旧书签落到 Chat 重定向页。
|
||||
*/
|
||||
export const WORKSPACE_PATHS = {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* features/workspace/views/AccountingVoucherCheckDetailView.vue
|
||||
* 用途:立账凭证检核批次明细独立页,支持按 invoice 或按文件类型汇总。
|
||||
* 依赖:voucherCheck.api、PaginationBar、vue-router、vue-i18n、useMessage、voucherCheck.display。
|
||||
* 逻辑:路由 /workspace/accounting-voucher-check/runs/:runId;标题下用下划线 Tab 切换汇总维度;状态筛选仅在按 invoice 时出现。
|
||||
* 逻辑:独立路由或 Chat 嵌入;标题下用下划线 Tab 切换汇总维度;状态筛选仅在按 invoice 时出现。
|
||||
* Chat 嵌入时 runId / runNo 由父级传入,返回列表通过 close 事件。
|
||||
*/
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@@ -24,6 +25,20 @@ import {
|
||||
voucherCheckStatusLabel,
|
||||
} from '../utils/voucherCheck.display';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
runId?: number;
|
||||
runNo?: string | null;
|
||||
}>(), {
|
||||
embedded: false,
|
||||
runId: 0,
|
||||
runNo: null,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
const route = useRoute();
|
||||
@@ -40,12 +55,17 @@ const runNo = ref('');
|
||||
const viewMode = ref<'invoice' | 'fileType'>('invoice');
|
||||
|
||||
const scheduleRunId = computed(() => {
|
||||
if (props.embedded) {
|
||||
const id = Number(props.runId);
|
||||
return Number.isInteger(id) && id > 0 ? id : 0;
|
||||
}
|
||||
const raw = route.params.runId;
|
||||
const id = Number(Array.isArray(raw) ? raw[0] : raw);
|
||||
return Number.isFinite(id) && id > 0 ? id : 0;
|
||||
});
|
||||
|
||||
const titleRunId = computed(() => {
|
||||
if (props.embedded && props.runNo) return props.runNo;
|
||||
const q = route.query.runNo;
|
||||
if (typeof q === 'string' && q.trim()) return q.trim();
|
||||
return runNo.value || String(scheduleRunId.value || '');
|
||||
@@ -111,6 +131,10 @@ function setViewMode(mode: 'invoice' | 'fileType') {
|
||||
* 返回立账凭证检核任务列表。
|
||||
*/
|
||||
function backToList() {
|
||||
if (props.embedded) {
|
||||
emit('close');
|
||||
return;
|
||||
}
|
||||
void router.push(WORKSPACE_PATHS.accountingVoucherCheck);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/views/AccountingVoucherCheckView.vue
|
||||
* 用途:立账凭证检核任务列表——按资料所属期间(年 + 月)查看批次统计,并展示最近一次检核进度。
|
||||
* 用途:立账凭证检核任务列表——按资料所属期间(年 + 月)查看批次统计,并展示最近一次检核。
|
||||
* 依赖:voucherCheck.api、vue-i18n、useMessage、DeleteConfirmDialog、PaginationBar、formatLocalDateTime、voucherCheck.display、auth。
|
||||
* 逻辑:路由 /workspace/accounting-voucher-check;进页默认上一个自然月;「最近一次检核」不跟筛选;强制重检仅 admin,进度在本卡轮询。
|
||||
* Chat 嵌入时由 VoucherCheckChatPanel 传入 embedded / activeTab。
|
||||
* 逻辑:独立路由或 Chat 嵌入;进页默认上一个自然月;「最近一次检核」不跟筛选;强制重检仅 admin,进度在本卡轮询。
|
||||
* 终态用矮指标格;排队/执行中才展开进度条与当前步骤。Chat 嵌入时隐藏页头与内层 Tab。
|
||||
*/
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@@ -32,6 +34,18 @@ import {
|
||||
voucherCheckStepLabel,
|
||||
} from '../utils/voucherCheck.display';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
activeTab?: 'tasks' | 'notifications';
|
||||
}>(), {
|
||||
embedded: false,
|
||||
activeTab: 'tasks',
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
'open-detail': [payload: { runId: number; runNo?: string | null }];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
const route = useRoute();
|
||||
@@ -47,7 +61,7 @@ const pageSize = ref(50);
|
||||
const periodYear = ref('');
|
||||
const periodMonth = ref('');
|
||||
const status = ref('');
|
||||
const listTab = ref<'tasks' | 'notifications'>('tasks');
|
||||
const listTab = ref<'tasks' | 'notifications'>(props.activeTab);
|
||||
const notifyLoading = ref(false);
|
||||
const notifyItems = ref<VoucherCheckNotificationItem[]>([]);
|
||||
const notifyTotal = ref(0);
|
||||
@@ -74,6 +88,31 @@ const latestCanOpenDetail = computed(() => {
|
||||
return row.status === 'missing' || row.status === 'completed';
|
||||
});
|
||||
|
||||
/**
|
||||
* 最近一次检核的四个指标格,终态矮格与执行中共用。
|
||||
* 核心逻辑:缺件时后两项(缺件文件 / 缺件 invoice)标红。
|
||||
*/
|
||||
const latestMetrics = computed(() => {
|
||||
const row = latestRun.value;
|
||||
if (!row) return [];
|
||||
const warn = latestHasMissing.value;
|
||||
return [
|
||||
{ key: 'subject', value: row.subject_count, labelKey: 'workspace.voucherCheck.subjectCount', warn: false },
|
||||
{ key: 'archived', value: row.archived_file_count, labelKey: 'workspace.voucherCheck.archivedFiles', warn: false },
|
||||
{ key: 'missingFiles', value: row.missing_file_count, labelKey: 'workspace.voucherCheck.missingFiles', warn },
|
||||
{ key: 'missingInvoices', value: row.missing_invoice_count, labelKey: 'workspace.voucherCheck.missingInvoices', warn },
|
||||
];
|
||||
});
|
||||
|
||||
/**
|
||||
* 终态是否展示失败原因:仅技术失败或带 error_message 时占一行,完整/缺件不再重复完成提示。
|
||||
*/
|
||||
const latestShowFailureHint = computed(() => {
|
||||
const row = latestRun.value;
|
||||
if (!row || latestInProgress.value) return false;
|
||||
return row.status === 'technical_failed' || Boolean(row.error_message);
|
||||
});
|
||||
|
||||
const MONTH_VALUES = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] as const;
|
||||
|
||||
/**
|
||||
@@ -218,6 +257,20 @@ function formatRecipientNames(names?: string[]): string {
|
||||
return names.join('、');
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开批次明细:Chat 嵌入时回传父级,独立页则跳转工作台详情路由。
|
||||
*/
|
||||
function navigateToDetail(runId: number, runNo?: string | null) {
|
||||
if (props.embedded) {
|
||||
emit('open-detail', { runId, runNo: runNo || null });
|
||||
return;
|
||||
}
|
||||
void router.push({
|
||||
path: WORKSPACE_PATHS.accountingVoucherCheckDetail(runId),
|
||||
query: runNo ? { runNo } : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 从发送记录跳转对应批次明细。
|
||||
* @param row - 企微发送记录
|
||||
@@ -227,10 +280,7 @@ function openNotifyDetail(row: VoucherCheckNotificationItem) {
|
||||
msg.error(t('workspace.voucherCheck.loadFailed'));
|
||||
return;
|
||||
}
|
||||
void router.push({
|
||||
path: WORKSPACE_PATHS.accountingVoucherCheckDetail(row.schedule_run_id),
|
||||
query: row.run_no ? { runNo: row.run_no } : undefined,
|
||||
});
|
||||
navigateToDetail(row.schedule_run_id, row.run_no);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,10 +324,7 @@ function openRunDetail(row: VoucherCheckRunItem) {
|
||||
msg.error(t('workspace.voucherCheck.loadFailed'));
|
||||
return;
|
||||
}
|
||||
void router.push({
|
||||
path: WORKSPACE_PATHS.accountingVoucherCheckDetail(row.schedule_run_id),
|
||||
query: row.run_no ? { runNo: row.run_no } : undefined,
|
||||
});
|
||||
navigateToDetail(row.schedule_run_id, row.run_no);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,10 +453,7 @@ function openLatestDetail() {
|
||||
msg.error(t('workspace.voucherCheck.loadFailed'));
|
||||
return;
|
||||
}
|
||||
void router.push({
|
||||
path: WORKSPACE_PATHS.accountingVoucherCheckDetail(row.schedule_run_id),
|
||||
query: row.run_no ? { runNo: row.run_no } : undefined,
|
||||
});
|
||||
navigateToDetail(row.schedule_run_id, row.run_no);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,13 +463,27 @@ watch([listTab, latestInProgress], () => {
|
||||
syncLatestPoll();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.activeTab,
|
||||
(tab) => {
|
||||
if (!props.embedded) return;
|
||||
if (listTab.value === tab) return;
|
||||
setListTab(tab);
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
if (redirectLegacyRunQuery()) return;
|
||||
if (!props.embedded && redirectLegacyRunQuery()) return;
|
||||
const previous = previousYearMonth();
|
||||
periodYear.value = previous.year;
|
||||
periodMonth.value = previous.month;
|
||||
const qStatus = route.query.status;
|
||||
if (typeof qStatus === 'string' && qStatus) status.value = qStatus;
|
||||
if (props.embedded) listTab.value = props.activeTab;
|
||||
if (listTab.value === 'notifications') {
|
||||
await loadNotifications();
|
||||
return;
|
||||
}
|
||||
await Promise.all([loadRuns(), loadLatestRun()]);
|
||||
});
|
||||
|
||||
@@ -435,13 +493,13 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-5 animate-fade-in-up">
|
||||
<header class="space-y-1">
|
||||
<div class="space-y-4 animate-fade-in-up">
|
||||
<header v-if="!embedded" class="space-y-1">
|
||||
<h1 class="text-2xl font-bold text-primary">{{ $t('workspace.voucherCheck.title') }}</h1>
|
||||
<p class="text-sm text-muted">{{ $t('workspace.voucherCheck.subtitle') }}</p>
|
||||
</header>
|
||||
|
||||
<div class="flex gap-1 border-b border-default" role="tablist">
|
||||
<div v-if="!embedded" class="flex gap-1 border-b border-default" role="tablist">
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
@@ -469,19 +527,30 @@ onUnmounted(() => {
|
||||
class="overflow-hidden rounded-2xl border border-default bg-surface"
|
||||
aria-live="polite"
|
||||
>
|
||||
<div class="flex flex-wrap items-start justify-between gap-3 bg-blue-50 px-4 py-3.5">
|
||||
<div
|
||||
class="flex flex-wrap items-start justify-between gap-3 px-4 py-2.5"
|
||||
:class="latestInProgress ? 'bg-blue-50' : ''"
|
||||
>
|
||||
<div>
|
||||
<h2 class="text-[15px] font-semibold text-primary">{{ $t('workspace.voucherCheck.latestTitle') }}</h2>
|
||||
<p v-if="latestRun" class="mt-1 text-xs text-muted">
|
||||
<h2 class="text-sm font-semibold text-primary">{{ $t('workspace.voucherCheck.latestTitle') }}</h2>
|
||||
<p v-if="latestRun" class="mt-0.5 text-xs text-muted">
|
||||
<span class="mr-3">{{ $t('workspace.voucherCheck.latestBatch', { runNo: latestRun.run_no }) }}</span>
|
||||
<span class="mr-3">{{ $t('workspace.voucherCheck.latestPeriod', { period: latestRun.period_month || '-' }) }}</span>
|
||||
<span>{{ voucherCheckModeLabel(t, latestRun.mode) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
<button
|
||||
v-if="latestCanOpenDetail"
|
||||
type="button"
|
||||
class="text-sm font-semibold text-brand-700 hover:underline"
|
||||
@click="openLatestDetail"
|
||||
>
|
||||
{{ $t('workspace.voucherCheck.viewLatestDetail') }}
|
||||
</button>
|
||||
<span
|
||||
v-if="latestRun"
|
||||
class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold"
|
||||
class="inline-flex rounded-full px-2.5 py-0.5 text-xs font-semibold"
|
||||
:class="latestBadgeClass(latestRun.status)"
|
||||
>
|
||||
{{ voucherCheckStatusLabel(t, latestRun.status) }}
|
||||
@@ -499,67 +568,50 @@ onUnmounted(() => {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4 py-3.5">
|
||||
<div v-if="latestLoading && !latestRun" class="flex items-center justify-center gap-2 py-8 text-sm text-muted">
|
||||
<Loader2 class="h-4 w-4 animate-spin" />
|
||||
{{ $t('workspace.voucherCheck.loading') }}
|
||||
</div>
|
||||
<p v-else-if="!latestRun" class="py-8 text-center text-sm text-muted">
|
||||
{{ $t('workspace.voucherCheck.latestEmpty') }}
|
||||
</p>
|
||||
<template v-else>
|
||||
<div class="h-2.5 overflow-hidden rounded-full bg-slate-200">
|
||||
<div v-if="latestLoading && !latestRun" class="flex items-center justify-center gap-2 px-4 py-6 text-sm text-muted">
|
||||
<Loader2 class="h-4 w-4 animate-spin" />
|
||||
{{ $t('workspace.voucherCheck.loading') }}
|
||||
</div>
|
||||
<p v-else-if="!latestRun" class="px-4 py-6 text-center text-sm text-muted">
|
||||
{{ $t('workspace.voucherCheck.latestEmpty') }}
|
||||
</p>
|
||||
<div v-else class="px-4 pb-3">
|
||||
<template v-if="latestInProgress">
|
||||
<div class="h-2 overflow-hidden rounded-full bg-slate-200">
|
||||
<div
|
||||
class="h-full rounded-full transition-[width] duration-300"
|
||||
:class="latestRun.status === 'technical_failed' ? 'bg-rose-600' : 'bg-teal-700'"
|
||||
class="h-full rounded-full bg-teal-700 transition-[width] duration-300"
|
||||
:style="{ width: `${latestRun.progress_percent || 0}%` }"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-2 mb-3.5 flex flex-wrap justify-between gap-3 text-xs text-muted">
|
||||
<div class="mt-1.5 mb-2.5 flex flex-wrap justify-between gap-3 text-xs text-muted">
|
||||
<span>{{ $t('workspace.voucherCheck.progress', { percent: latestRun.progress_percent || 0 }) }}</span>
|
||||
<span>
|
||||
{{ $t('workspace.voucherCheck.startedAt') }}:{{ formatLocalDateTime(latestRun.started_at) }}
|
||||
{{ $t('workspace.voucherCheck.finishedAt') }}:{{ latestInProgress ? $t('workspace.voucherCheck.inProgress') : formatLocalDateTime(latestRun.finished_at) }}
|
||||
{{ $t('workspace.voucherCheck.finishedAt') }}:{{ $t('workspace.voucherCheck.inProgress') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-2 md:grid-cols-4">
|
||||
<div class="rounded-[10px] border border-default bg-slate-50 px-2.5 py-3">
|
||||
<b class="block text-[22px] font-semibold leading-tight text-primary">{{ latestRun.subject_count }}</b>
|
||||
<span class="text-xs text-muted">{{ $t('workspace.voucherCheck.subjectCount') }}</span>
|
||||
</div>
|
||||
<div class="rounded-[10px] border border-default bg-slate-50 px-2.5 py-3">
|
||||
<b class="block text-[22px] font-semibold leading-tight text-primary">{{ latestRun.archived_file_count }}</b>
|
||||
<span class="text-xs text-muted">{{ $t('workspace.voucherCheck.archivedFiles') }}</span>
|
||||
</div>
|
||||
<div class="rounded-[10px] border border-default bg-slate-50 px-2.5 py-3">
|
||||
<b
|
||||
class="block text-[22px] font-semibold leading-tight"
|
||||
:class="latestHasMissing ? 'text-rose-700' : 'text-primary'"
|
||||
>{{ latestRun.missing_file_count }}</b>
|
||||
<span class="text-xs text-muted">{{ $t('workspace.voucherCheck.missingFiles') }}</span>
|
||||
</div>
|
||||
<div class="rounded-[10px] border border-default bg-slate-50 px-2.5 py-3">
|
||||
<b
|
||||
class="block text-[22px] font-semibold leading-tight"
|
||||
:class="latestHasMissing ? 'text-rose-700' : 'text-primary'"
|
||||
>{{ latestRun.missing_invoice_count }}</b>
|
||||
<span class="text-xs text-muted">{{ $t('workspace.voucherCheck.missingInvoices') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 text-[13px] text-slate-700">
|
||||
<p class="mb-2.5 text-[13px] text-slate-700">
|
||||
{{ latestStepText(latestRun) }}
|
||||
<small v-if="latestHintText(latestRun)" class="mt-0.5 block text-muted">{{ latestHintText(latestRun) }}</small>
|
||||
</p>
|
||||
<div v-if="latestCanOpenDetail" class="mt-3 flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="text-sm font-semibold text-brand-700 hover:underline"
|
||||
@click="openLatestDetail"
|
||||
>
|
||||
{{ $t('workspace.voucherCheck.viewLatestDetail') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="grid grid-cols-2 gap-2 md:grid-cols-4">
|
||||
<div
|
||||
v-for="metric in latestMetrics"
|
||||
:key="metric.key"
|
||||
class="rounded-[10px] border border-default bg-slate-50 px-2.5 py-2"
|
||||
>
|
||||
<b
|
||||
class="block text-lg font-semibold leading-tight tabular-nums"
|
||||
:class="metric.warn ? 'text-rose-700' : 'text-primary'"
|
||||
>{{ metric.value }}</b>
|
||||
<span class="text-[11px] text-muted">{{ $t(metric.labelKey) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="latestShowFailureHint" class="mt-2 text-[13px] text-slate-700">
|
||||
{{ latestStepText(latestRun) }}
|
||||
<small v-if="latestHintText(latestRun)" class="mt-0.5 block text-muted">{{ latestHintText(latestRun) }}</small>
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
@@ -2370,7 +2370,9 @@
|
||||
"voucherCheckScope": "Ledger scope",
|
||||
"voucherCheckProfile": "Business profile",
|
||||
"voucherCheckNotifyMissing": "Notify on missing materials",
|
||||
"voucherCheckNotifyFailure": "Failure alert"
|
||||
"voucherCheckNotifyMissingHint": "Master switch. Set missing-file recipients in Chat “Accounting voucher check → Notification config” by file type. The schedule people picker is only for failure alerts.",
|
||||
"voucherCheckNotifyFailure": "Failure alert",
|
||||
"voucherCheckNotifyFailureHint": "Technical failures go to the people selected below."
|
||||
},
|
||||
"testRun": {
|
||||
"title": "Test run — {name}",
|
||||
@@ -4798,11 +4800,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "Contract Payment Alerts", "subtitle": "Sync OA contract, acceptance, and vendor prepayment requests; notify procurement roles through three escalation rounds.", "sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the ledger.", "sync": "Sync OA data", "forceSync": "Force overwrite OA fields", "forceSyncConfirm": "This will overwrite existing OA data with non-empty fields returned this time and record an audit trail. Continue?", "reparseExisting": "Reparse existing contracts", "reparseExistingConfirm": "This will refresh all existing contract parsing results from archived attachments using the current rules. OA fields will not be synced or overwritten. Continue?", "scanAlerts": "Scan to generate alerts", "jobSubmitted": "Job submitted", "actionFailed": "Action failed", "loadFailed": "Failed to load contracts", "searchPlaceholder": "Search contract number, purchase order, or supplier", "allStatus": "All", "search": "Search", "ledger": "Contract ledger", "items": "items", "empty": "No contract data", "purchaseOrder": "Purchase order", "supplier": "Supplier", "amount": "Contract amount", "deliveryDate": "Delivery due date", "timeline": "Payment plan timeline", "notAvailable": "—", "stats": {"contracts": "Contracts", "pendingParse": "Pending contracts", "readyPlans": "Plans ready", "alerts": "Alert nodes"}, "ledgerFocus": {"due": "Due soon", "dueHint": "within 7 days", "overdue": "Overdue unpaid", "active": "In progress", "dueThisMonth": "Due this month", "dueThisMonthHint": "this calendar month"}, "status": {"completed": "Completed", "needs_review": "Needs review", "pending": "Pending parse"}, "stateLabel": {"parsed": "Parsed", "needs_review": "Needs review", "pending": "Pending parse", "active": "Active"}, "nodeType": {"prepayment": "Prepayment", "shipment": "Shipment payment", "acceptance": "Acceptance payment", "warranty": "Warranty payment"}, "ruleConfirmed": "Confirmed", "prepaymentRule": "Alerts at 7/14/21 days after contract archival; request status comes from OA vendor prepayment requests.", "shipmentRule": "Alerts 7 days before delivery, on the due date, and 14 days after; request status comes from OA vendor prepayment requests.", "acceptanceRule": "Alerts at 30/40/60 days after acceptance archival; warranty alerts are 7 days before, on, and 14 days after maturity.", "pendingAlerts": "Pending alerts", "processing": "Payment initiated", "dataPending": "Data pending", "paid": "Paid", "amountRatioDate": "Amount / ratio · date", "applicant": "Applicant", "statusLabel": "Status", "contractPrefix": "Contract", "datePending": "Date pending", "statusNormal": "Normal", "statusNeedsCompletion": "Needs completion", "statusOverdue": "Overdue", "statusUpcoming": "Due soon", "statusActive": "In progress", "statusCompleted": "Completed", "totalPrefix": "Total", "contractSupplier": "Contract / supplier", "nextAlert": "Next alert", "triggerBasis": "Trigger basis", "alertDate": "Alert date", "alertFirstRound": "Round 1", "payDate": "Payment date", "processStatus": "Status", "owner": "Procurement owner", "oaData": "OA data", "contractRule": "Contract rule", "ownerDefault": "Procurement owner", "workflowNo": "Workflow number", "contractNoPending": "Contract number pending attachment parsing", "synced": "Synced", "detailSubtitle": "OA data, payment nodes, and WeCom alert records", "backToOverview": "Back to overview", "contractInfo": "OA contract details", "alertHistory": "Alert history", "alertRound": "Alert round {round}", "alertAudit": "Alert delivery record", "alertAuditEmpty": "No alert records", "alertNode": "Payment stage", "alertScheduledAt": "Scheduled date", "alertSentAt": "Sent at", "alertStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed"}, "roundValue": "Round {round}", "weeklyBatchesTitle": "Weekly Summary Batches", "weeklyBatchesSubtitle": "Review recipient-level payment-alert summaries, Excel attachments, and delivery records.", "weeklySend": "Send alerts", "weeklyBatchSubmitted": "Send alert job submitted", "weeklyBatchesLoadFailed": "Failed to load weekly summary batches", "batchNo": "Batch no.", "weekKey": "Week", "batchStatusLabel": "Delivery status", "batchTotal": "Summary count", "batchExcel": "Excel attachment", "batchSentAt": "Sent at", "weeklyBatchesEmpty": "No weekly summary batches", "weeklyPendingSummary": "{count} pending this week · next send {datetime}", "weeklyPendingCountOnly": "{count} pending this week", "downloadExcel": "Download Excel", "excelDownloadFailed": "Failed to download the alert attachment", "batchStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed", "processing": "Processing", "resolved": "Alerts stopped"}, "backToLedger": "Back", "detailLoadFailed": "Failed to load contract details", "detailLoading": "Loading contract details…", "detailOverview": "Contract Overview", "detailAttachments": "Original Attachments", "detailPaymentPlan": "Payment Plan", "detailAlertHistory": "Alert History", "archivLine truncated
|
||||
"title": "Contract Payment Alerts", "subtitle": "Sync OA contract, acceptance, and vendor prepayment requests; notify procurement roles through three escalation rounds.", "sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the ledger.", "sync": "Sync OA data", "forceSync": "Force overwrite OA fields", "forceSyncConfirm": "This will overwrite existing OA data with non-empty fields returned this time and record an audit trail. Continue?", "reparseExisting": "Reparse existing contracts", "reparseExistingConfirm": "This will refresh all existing contract parsing results from archived attachments using the current rules. OA fields will not be synced or overwritten. Continue?", "scanAlerts": "Scan to generate alerts", "jobSubmitted": "Job submitted", "actionFailed": "Action failed", "loadFailed": "Failed to load contracts", "searchPlaceholder": "Search contract number, purchase order, supplier, or applicant", "allStatus": "All", "search": "Search", "ledger": "Contract ledger", "items": "items", "empty": "No contract data", "purchaseOrder": "Purchase order", "supplier": "Supplier", "amount": "Contract amount", "deliveryDate": "Delivery due date", "timeline": "Payment plan timeline", "notAvailable": "—", "stats": {"contracts": "Contracts", "pendingParse": "Pending contracts", "readyPlans": "Plans ready", "alerts": "Alert nodes"}, "ledgerFocus": {"due": "Due soon", "dueHint": "within 7 days", "overdue": "Overdue unpaid", "active": "In progress", "dueThisMonth": "Due this month", "dueThisMonthHint": "this calendar month"}, "status": {"completed": "Completed", "needs_review": "Needs review", "pending": "Pending parse"}, "stateLabel": {"parsed": "Parsed", "needs_review": "Needs review", "pending": "Pending parse", "active": "Active"}, "nodeType": {"prepayment": "Prepayment", "shipment": "Shipment payment", "acceptance": "Acceptance payment", "warranty": "Warranty payment"}, "ruleConfirmed": "Confirmed", "prepaymentRule": "Alerts at 7/14/21 days after contract archival; request status comes from OA vendor prepayment requests.", "shipmentRule": "Alerts 7 days before delivery, on the due date, and 14 days after; request status comes from OA vendor prepayment requests.", "acceptanceRule": "Alerts at 30/40/60 days after acceptance archival; warranty alerts are 7 days before, on, and 14 days after maturity.", "pendingAlerts": "Pending alerts", "processing": "Payment initiated", "dataPending": "Data pending", "paid": "Paid", "amountRatioDate": "Amount / ratio · date", "applicant": "Applicant", "statusLabel": "Status", "contractPrefix": "Contract", "datePending": "Date pending", "statusNormal": "Normal", "statusNeedsCompletion": "Needs completion", "statusOverdue": "Overdue", "statusUpcoming": "Due soon", "statusActive": "In progress", "statusCompleted": "Completed", "totalPrefix": "Total", "contractSupplier": "Contract / supplier", "nextAlert": "Next alert", "triggerBasis": "Trigger basis", "alertDate": "Alert date", "alertFirstRound": "Round 1", "payDate": "Payment date", "processStatus": "Status", "owner": "Procurement owner", "oaData": "OA data", "contractRule": "Contract rule", "ownerDefault": "Procurement owner", "workflowNo": "Workflow number", "contractNoPending": "Contract number pending attachment parsing", "synced": "Synced", "detailSubtitle": "OA data, payment nodes, and WeCom alert records", "backToOverview": "Back to overview", "contractInfo": "OA contract details", "alertHistory": "Alert history", "alertRound": "Alert round {round}", "alertAudit": "Alert delivery record", "alertAuditEmpty": "No alert records", "alertNode": "Payment stage", "alertScheduledAt": "Scheduled date", "alertSentAt": "Sent at", "alertStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed"}, "roundValue": "Round {round}", "weeklyBatchesTitle": "Weekly Summary Batches", "weeklyBatchesSubtitle": "Review recipient-level payment-alert summaries, Excel attachments, and delivery records.", "weeklySend": "Send alerts", "weeklyBatchSubmitted": "Send alert job submitted", "weeklyBatchesLoadFailed": "Failed to load weekly summary batches", "batchNo": "Batch no.", "weekKey": "Week", "batchStatusLabel": "Delivery status", "batchTotal": "Summary count", "batchExcel": "Excel attachment", "batchSentAt": "Sent at", "weeklyBatchesEmpty": "No weekly summary batches", "weeklyPendingSummary": "{count} pending this week · next send {datetime}", "weeklyPendingCountOnly": "{count} pending this week", "downloadExcel": "Download Excel", "excelDownloadFailed": "Failed to download the alert attachment", "batchStatus": {"pending": "Pending", "sent": "Sent", "failed": "Failed", "processing": "Processing", "resolved": "Alerts stopped"}, "backToLedger": "Back", "detailLoadFailed": "Failed to load contract details", "detailLoading": "Loading contract details…", "detailOverview": "Contract Overview", "detailAttachments": "Original Attachments", "detailPaymentPlan": "Payment Plan", "detailAlertHistory": "Alert HistorLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, or supplier", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"contractPaymentReparse": {"action": "Reparse contract original", "success": "Reparsed with attachment “{attachment}”", "failed": "Failed to reparse contract"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, or supplier", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"contractPaymentReview": {"title": "Contracts for Confirmation", "subtitle": "Contracts that do not match the equipment procurement synonym title groups, fail payment-ratio validation, or conflict with OA fields are excluded from payment alerts. Download the original contract to verify it.", "searchPlaceholder": "Contract number, purchase order, supplier, or applicant", "loadFailed": "Failed to load contracts for confirmation", "contractWorkflow": "Contract / workflow number", "reason": "Reason for confirmation", "fallbackIssue": "Parsing result requires manual confirmation", "empty": "No contracts need confirmation"},
|
||||
"procurementContract": {
|
||||
"title": "Procurement Contract Review",
|
||||
"subtitle": "Manage templates, risk red-line rules, and review history",
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
},
|
||||
"agentId": "Agent ID:",
|
||||
"loadingAgent": "Loading agent...",
|
||||
"taskAgent": {
|
||||
"sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the workspace."
|
||||
},
|
||||
"thinking": "Generating response...",
|
||||
"stopGenerating": "Stop generating",
|
||||
"disclaimer": "AI can make mistakes. Please verify important information.",
|
||||
|
||||
@@ -44,5 +44,22 @@
|
||||
"asc": "Ascending, click for descending",
|
||||
"desc": "Descending, click for ascending"
|
||||
},
|
||||
"required": "This field is required"
|
||||
"required": "This field is required",
|
||||
"userPicker": {
|
||||
"title": "Select people",
|
||||
"subtitle": "Filter by department, or search by name or employee ID.",
|
||||
"subtitleWithWecom": "Filter by department, or search by name or employee ID. People without WeCom can still be selected; they are skipped when sending.",
|
||||
"searchPlaceholder": "Search name / employee ID",
|
||||
"allDepartments": "All",
|
||||
"unknownDepartment": "No department",
|
||||
"selectDepartment": "Select this department",
|
||||
"selectVisible": "Select all in view",
|
||||
"select": "Select",
|
||||
"empty": "No matching people",
|
||||
"noneSelected": "None selected",
|
||||
"emptyTrigger": "None selected",
|
||||
"confirmCount": "OK ({count})",
|
||||
"wecomBound": "WeCom bound",
|
||||
"wecomUnbound": "WeCom not bound"
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,8 @@
|
||||
"CHAT.USER_ATTACHMENTS_LIMIT_EXCEEDED": "Too many attachments (maximum 200). Remove some and try again.",
|
||||
"CONTRACT_PAYMENT_FORBIDDEN": "You do not have access to contract payment alerts.",
|
||||
"CONTRACT_PAYMENT_ADMIN_REQUIRED": "Only administrators can sync, scan, or send contract payment alerts.",
|
||||
"VOUCHER_CHECK_FORBIDDEN": "You do not have access to accounting voucher check.",
|
||||
"VOUCHER_CHECK_ADMIN_REQUIRED": "Only administrators can force a voucher recheck or change missing-file notification recipients.",
|
||||
"SHIPPING_TASK_SELECTION_INVALID": "Select between 1 and 100 shipping tasks.",
|
||||
"SHIPPING_TASK_DELETE_REASON_REQUIRED": "A reason is required to delete or void tasks.",
|
||||
"SHIPPING_TASK_EXTERNAL_VOID_BLOCKED": "The task is uploading externally or has been uploaded. It can only be archived.",
|
||||
|
||||
@@ -939,6 +939,20 @@
|
||||
"stepDone": "Check complete",
|
||||
"tabTasks": "Check tasks",
|
||||
"tabNotifications": "WeCom send log",
|
||||
"tabNotifyConfig": "Notification config",
|
||||
"notifyConfigTitle": "Recipients by file type",
|
||||
"notifyConfigSubtitle": "The six file types can go to different teams. Each person only sees the missing types they own; the Excel file remains the full detail. The schedule “Enable notifications” switch is the master on/off; the schedule people picker is only for failure alerts.",
|
||||
"notifyConfigSave": "Save",
|
||||
"notifyConfigSaved": "Notification config saved",
|
||||
"notifyConfigLoadFailed": "Failed to load notification config",
|
||||
"notifyConfigSaveFailed": "Failed to save notification config",
|
||||
"notifyConfigSelectUsers": "Select recipients…",
|
||||
"notifyConfigPickerTitle": "Select recipients",
|
||||
"notifyConfigEmptyUsers": "No recipients selected",
|
||||
"notifyConfigNoUsers": "No matching users",
|
||||
"notifyConfigWecomUnbound": "WeCom not bound",
|
||||
"notifyConfigFolder": "Type folder {folder}",
|
||||
"notifyConfigUpdatedAt": "Last saved {time}",
|
||||
"notifyEmpty": "No WeCom send records yet",
|
||||
"notifyLoadFailed": "Failed to load send records",
|
||||
"notifyStatus": "Send status",
|
||||
|
||||
@@ -2248,7 +2248,9 @@
|
||||
"voucherCheckScope": "ชุดบัญชี",
|
||||
"voucherCheckProfile": "โปรไฟล์ฝ่ายธุรกิจ",
|
||||
"voucherCheckNotifyMissing": "แจ้งเตือนเมื่อขาดเอกสาร",
|
||||
"voucherCheckNotifyFailure": "แจ้งเตือนเมื่อล้มเหลว"
|
||||
"voucherCheckNotifyMissingHint": "สวิตช์หลัก กำหนดผู้รับไฟล์ขาดในแชท 「ตรวจเอกสารบัญชี → ตั้งค่าการแจ้งเตือน」 ตามประเภทไฟล์ การเลือกคนด้านล่างใช้สำหรับแจ้งเตือนเมื่อล้มเหลวเท่านั้น",
|
||||
"voucherCheckNotifyFailure": "แจ้งเตือนเมื่อล้มเหลว",
|
||||
"voucherCheckNotifyFailureHint": "เมื่อล้มเหลวทางเทคนิคจะส่งให้ผู้ที่เลือกด้านล่าง"
|
||||
},
|
||||
"status": {
|
||||
"all": "ทุกสถานะ",
|
||||
@@ -4667,11 +4669,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "แจ้งเตือนการชำระเงินตามสัญญา", "subtitle": "ซิงก์สัญญา OA การรับมอบ และคำขอเบิกเงินล่วงหน้าของผู้ขาย พร้อมแจ้งเตือน 3 ระดับ", "sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดบัญชีจากแท็บด้านบน", "sync": "ซิงก์ข้อมูล OA", "forceSync": "เขียนทับฟิลด์ OA แบบบังคับ", "forceSyncConfirm": "ระบบจะเขียนทับข้อมูล OA เดิมด้วยฟิลด์ที่ไม่ว่างจาก OA ครั้งนี้และบันทึกการตรวจสอบ ต้องการดำเนินการต่อหรือไม่?", "reparseExisting": "แยกวิเคราะห์สัญญาเดิมทั้งหมดใหม่", "reparseExistingConfirm": "ระบบจะรีเฟรชผลการแยกข้อมูลของสัญญาเดิมทั้งหมดจากไฟล์แนบที่จัดเก็บตามกฎปัจจุบัน โดยจะไม่ซิงก์หรือเขียนทับฟิลด์ OA ต้องการดำเนินการต่อหรือไม่?", "scanAlerts": "สแกนเพื่อสร้างแจ้งเตือน", "jobSubmitted": "ส่งงานแล้ว", "actionFailed": "ดำเนินการไม่สำเร็จ", "loadFailed": "โหลดสัญญาไม่สำเร็จ", "searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ หรือผู้ขาย", "allStatus": "ทั้งหมด", "search": "ค้นหา", "ledger": "ทะเบียนสัญญา", "items": "รายการ", "empty": "ไม่มีข้อมูลสัญญา", "purchaseOrder": "ใบสั่งซื้อ", "supplier": "ผู้ขาย", "amount": "มูลค่าสัญญา", "deliveryDate": "กำหนดส่งมอบ", "timeline": "ไทม์ไลน์แผนการชำระเงิน", "notAvailable": "—", "stats": {"contracts": "สัญญา", "pendingParse": "สัญญาที่รอดำเนินการ", "readyPlans": "แผนพร้อมใช้", "alerts": "จุดแจ้งเตือน"}, "ledgerFocus": {"due": "ใกล้ครบกำหนด", "dueHint": "ใน 7 วัน", "overdue": "ค้างชำระเกินกำหนด", "active": "กำลังดำเนินการ", "dueThisMonth": "ถึงกำหนดเดือนนี้", "dueThisMonthHint": "เดือนปฏิทินนี้"}, "status": {"completed": "เสร็จสิ้น", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล"}, "stateLabel": {"parsed": "แยกข้อมูลแล้ว", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล", "active": "ใช้งานอยู่"}, "nodeType": {"prepayment": "เงินล่วงหน้า", "shipment": "เงินก่อนส่ง", "acceptance": "เงินรับมอบ", "warranty": "เงินประกัน"}, "ruleConfirmed": "ยืนยันแล้ว", "prepaymentRule": "แจ้งเตือนวันที่ 7/14/21 หลังจัดเก็บสัญญา; สถานะคำขออ้างอิง OA.", "shipmentRule": "แจ้งเตือนก่อนกำหนดส่ง 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน; สถานะคำขออ้างอิง OA.", "acceptanceRule": "แจ้งเตือนวันที่ 30/40/60 หลังจัดเก็บใบรับมอบ; เงินประกันแจ้งก่อนครบกำหนด 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน.", "pendingAlerts": "แจ้งเตือนที่รอดำเนินการ", "processing": "เริ่มชำระแล้ว", "dataPending": "รอข้อมูล", "paid": "ชำระแล้ว", "amountRatioDate": "จำนวนเงิน / สัดส่วน · วันที่", "applicant": "ผู้ขอ", "statusLabel": "สถานะ", "contractPrefix": "สัญญา", "datePending": "รอระบุวันที่", "statusNormal": "ปกติ", "statusNeedsCompletion": "ต้องเติมข้อมูLine truncated
|
||||
"title": "แจ้งเตือนการชำระเงินตามสัญญา", "subtitle": "ซิงก์สัญญา OA การรับมอบ และคำขอเบิกเงินล่วงหน้าของผู้ขาย พร้อมแจ้งเตือน 3 ระดับ", "sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดบัญชีจากแท็บด้านบน", "sync": "ซิงก์ข้อมูล OA", "forceSync": "เขียนทับฟิลด์ OA แบบบังคับ", "forceSyncConfirm": "ระบบจะเขียนทับข้อมูล OA เดิมด้วยฟิลด์ที่ไม่ว่างจาก OA ครั้งนี้และบันทึกการตรวจสอบ ต้องการดำเนินการต่อหรือไม่?", "reparseExisting": "แยกวิเคราะห์สัญญาเดิมทั้งหมดใหม่", "reparseExistingConfirm": "ระบบจะรีเฟรชผลการแยกข้อมูลของสัญญาเดิมทั้งหมดจากไฟล์แนบที่จัดเก็บตามกฎปัจจุบัน โดยจะไม่ซิงก์หรือเขียนทับฟิลด์ OA ต้องการดำเนินการต่อหรือไม่?", "scanAlerts": "สแกนเพื่อสร้างแจ้งเตือน", "jobSubmitted": "ส่งงานแล้ว", "actionFailed": "ดำเนินการไม่สำเร็จ", "loadFailed": "โหลดสัญญาไม่สำเร็จ", "searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "allStatus": "ทั้งหมด", "search": "ค้นหา", "ledger": "ทะเบียนสัญญา", "items": "รายการ", "empty": "ไม่มีข้อมูลสัญญา", "purchaseOrder": "ใบสั่งซื้อ", "supplier": "ผู้ขาย", "amount": "มูลค่าสัญญา", "deliveryDate": "กำหนดส่งมอบ", "timeline": "ไทม์ไลน์แผนการชำระเงิน", "notAvailable": "—", "stats": {"contracts": "สัญญา", "pendingParse": "สัญญาที่รอดำเนินการ", "readyPlans": "แผนพร้อมใช้", "alerts": "จุดแจ้งเตือน"}, "ledgerFocus": {"due": "ใกล้ครบกำหนด", "dueHint": "ใน 7 วัน", "overdue": "ค้างชำระเกินกำหนด", "active": "กำลังดำเนินการ", "dueThisMonth": "ถึงกำหนดเดือนนี้", "dueThisMonthHint": "เดือนปฏิทินนี้"}, "status": {"completed": "เสร็จสิ้น", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล"}, "stateLabel": {"parsed": "แยกข้อมูลแล้ว", "needs_review": "ต้องตรวจสอบ", "pending": "รอแยกข้อมูล", "active": "ใช้งานอยู่"}, "nodeType": {"prepayment": "เงินล่วงหน้า", "shipment": "เงินก่อนส่ง", "acceptance": "เงินรับมอบ", "warranty": "เงินประกัน"}, "ruleConfirmed": "ยืนยันแล้ว", "prepaymentRule": "แจ้งเตือนวันที่ 7/14/21 หลังจัดเก็บสัญญา; สถานะคำขออ้างอิง OA.", "shipmentRule": "แจ้งเตือนก่อนกำหนดส่ง 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน; สถานะคำขออ้างอิง OA.", "acceptanceRule": "แจ้งเตือนวันที่ 30/40/60 หลังจัดเก็บใบรับมอบ; เงินประกันแจ้งก่อนครบกำหนด 7 วัน วันครบกำหนด และหลังครบกำหนด 14 วัน.", "pendingAlerts": "แจ้งเตือนที่รอดำเนินการ", "processing": "เริ่มชำระแล้ว", "dataPending": "รอข้อมูล", "paid": "ชำระแล้ว", "amountRatioDate": "จำนวนเงิน / สัดส่วน · วันที่", "applicant": "ผู้ขอ", "statusLabel": "สถานะ", "contractPrefix": "สัญญา", "datePending": "รอระบุวันที่", "statusNormal": "ปกติ", "statusNeedsCompletion": "ต้องเติมLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ หรือผู้ขาย", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReparse": {"action": "แยกข้อมูลจากต้นฉบับอีกครั้ง", "success": "แยกข้อมูลใหม่ด้วยไฟล์แนบ “{attachment}” แล้ว", "failed": "แยกข้อมูลสัญญาใหม่ไม่สำเร็จ"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ หรือผู้ขาย", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReview": {"title": "สัญญาที่รอยืนยัน", "subtitle": "สัญญาที่ไม่ตรงกับกลุ่มหัวข้อคำพ้องของสัญญาจัดซื้ออุปกรณ์ ตรวจสอบสัดส่วนการชำระเงินไม่ผ่าน หรือขัดแย้งกับฟิลด์ OA จะไม่เข้าสู่การแจ้งเตือนการชำระเงิน โปรดดาวน์โหลดต้นฉบับเพื่อตรวจสอบ", "searchPlaceholder": "เลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ", "loadFailed": "โหลดสัญญาที่รอยืนยันไม่สำเร็จ", "contractWorkflow": "เลขที่สัญญา / เวิร์กโฟลว์", "reason": "เหตุผลที่ต้องยืนยัน", "fallbackIssue": "ผลการแยกข้อมูลต้องยืนยันโดยผู้ใช้", "empty": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"procurementContract": {
|
||||
"title": "ตรวจสอบสัญญาจัดซื้อ",
|
||||
"subtitle": "จัดการเทมเพลต กฎเส้นแดงความเสี่ยง และประวัติการตรวจสอบ",
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
},
|
||||
"agentId": "รหัสตัวแทน:",
|
||||
"loadingAgent": "กำลังโหลดตัวแทน...",
|
||||
"taskAgent": {
|
||||
"sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดเนื้อหาจากแท็บด้านบน"
|
||||
},
|
||||
"thinking": "กำลังสร้างคำตอบ...",
|
||||
"stopGenerating": "หยุดสร้างคำตอบ",
|
||||
"disclaimer": "AI อาจทำผิดพลาดได้ โปรดตรวจสอบข้อมูลสำคัญ",
|
||||
|
||||
@@ -44,5 +44,22 @@
|
||||
"asc": "เรียงจากน้อยไปมาก คลิกเพื่อสลับ",
|
||||
"desc": "เรียงจากมากไปน้อย คลิกเพื่อสลับ"
|
||||
},
|
||||
"required": "กรุณากรอกข้อมูลที่จำเป็น"
|
||||
"required": "กรุณากรอกข้อมูลที่จำเป็น",
|
||||
"userPicker": {
|
||||
"title": "เลือกผู้ใช้",
|
||||
"subtitle": "กรองตามแผนก หรือค้นหาด้วยชื่อ / รหัสพนักงาน",
|
||||
"subtitleWithWecom": "กรองตามแผนก หรือค้นหาด้วยชื่อ / รหัสพนักงาน คนที่ยังไม่ผูก WeCom เลือกได้ แต่ตอนส่งจะข้าม",
|
||||
"searchPlaceholder": "ค้นหาชื่อ / รหัสพนักงาน",
|
||||
"allDepartments": "ทั้งหมด",
|
||||
"unknownDepartment": "ไม่มีแผนก",
|
||||
"selectDepartment": "เลือกทั้งแผนก",
|
||||
"selectVisible": "เลือกทั้งหมดในรายการนี้",
|
||||
"select": "เลือก",
|
||||
"empty": "ไม่พบผู้ใช้ที่ตรงกัน",
|
||||
"noneSelected": "ยังไม่ได้เลือก",
|
||||
"emptyTrigger": "ยังไม่ได้เลือก",
|
||||
"confirmCount": "ตกลง ({count})",
|
||||
"wecomBound": "ผูก WeCom แล้ว",
|
||||
"wecomUnbound": "ยังไม่ผูก WeCom"
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,8 @@
|
||||
"CHAT.USER_ATTACHMENTS_LIMIT_EXCEEDED": "ไฟล์แนบเกินจำนวนที่อนุญาต (สูงสุด 200 ไฟล์) โปรดลดจำนวนแล้วลองใหม่",
|
||||
"CONTRACT_PAYMENT_FORBIDDEN": "คุณไม่มีสิทธิ์เข้าถึงการแจ้งเตือนการชำระเงินตามสัญญา",
|
||||
"CONTRACT_PAYMENT_ADMIN_REQUIRED": "เฉพาะผู้ดูแลระบบเท่านั้นที่ซิงก์ สแกน หรือส่งการแจ้งเตือนการชำระเงินตามสัญญาได้",
|
||||
"VOUCHER_CHECK_FORBIDDEN": "คุณไม่มีสิทธิ์เข้าถึงการตรวจเอกสารบัญชี",
|
||||
"VOUCHER_CHECK_ADMIN_REQUIRED": "เฉพาะผู้ดูแลระบบเท่านั้นที่บังคับตรวจเอกสารบัญชีใหม่ หรือแก้ผู้รับการแจ้งเตือนไฟล์ขาดได้",
|
||||
"SHIPPING_TASK_SELECTION_INVALID": "เลือกงานจัดส่งได้ 1 ถึง 100 งาน",
|
||||
"SHIPPING_TASK_DELETE_REASON_REQUIRED": "ต้องระบุเหตุผลในการลบหรือยกเลิกงาน",
|
||||
"SHIPPING_TASK_EXTERNAL_VOID_BLOCKED": "งานกำลังอัปโหลดภายนอกหรืออัปโหลดแล้ว จึงทำได้เพียงเก็บถาวร",
|
||||
|
||||
@@ -875,6 +875,20 @@
|
||||
"stepDone": "ตรวจเสร็จแล้ว",
|
||||
"tabTasks": "งานตรวจ",
|
||||
"tabNotifications": "ประวัติส่ง WeCom",
|
||||
"tabNotifyConfig": "ตั้งค่าการแจ้งเตือน",
|
||||
"notifyConfigTitle": "กำหนดผู้รับตามประเภทไฟล์",
|
||||
"notifyConfigSubtitle": "ไฟล์ 6 ประเภทอาจเป็นคนละแผนก ผู้รับแต่ละคนจะเห็นเฉพาะประเภทที่ขาดซึ่งตนรับผิดชอบ ส่วนรายละเอียดเต็มยังอยู่ใน Excel สวิตช์ “เปิดการแจ้งเตือน” ในตารางงานเป็นสวิตช์หลัก การเลือกคนในตารางงานใช้สำหรับแจ้งเตือนเมื่อล้มเหลวเท่านั้น",
|
||||
"notifyConfigSave": "บันทึก",
|
||||
"notifyConfigSaved": "บันทึกการตั้งค่าการแจ้งเตือนแล้ว",
|
||||
"notifyConfigLoadFailed": "โหลดการตั้งค่าการแจ้งเตือนไม่สำเร็จ",
|
||||
"notifyConfigSaveFailed": "บันทึกการตั้งค่าการแจ้งเตือนไม่สำเร็จ",
|
||||
"notifyConfigSelectUsers": "เลือกผู้รับ…",
|
||||
"notifyConfigPickerTitle": "เลือกผู้รับ",
|
||||
"notifyConfigEmptyUsers": "ยังไม่ได้เลือกผู้รับ",
|
||||
"notifyConfigNoUsers": "ไม่พบผู้ใช้ที่ตรงกัน",
|
||||
"notifyConfigWecomUnbound": "ยังไม่ผูก WeCom",
|
||||
"notifyConfigFolder": "โฟลเดอร์ประเภท {folder}",
|
||||
"notifyConfigUpdatedAt": "บันทึกล่าสุด {time}",
|
||||
"notifyEmpty": "ยังไม่มีประวัติส่ง WeCom",
|
||||
"notifyLoadFailed": "โหลดประวัติส่งไม่สำเร็จ",
|
||||
"notifyStatus": "สถานะการส่ง",
|
||||
|
||||
@@ -2482,7 +2482,9 @@
|
||||
"voucherCheckScope": "账套",
|
||||
"voucherCheckProfile": "业务方 Profile",
|
||||
"voucherCheckNotifyMissing": "缺资料通知",
|
||||
"voucherCheckNotifyFailure": "失败告警"
|
||||
"voucherCheckNotifyMissingHint": "总开关。缺件接收人请到 Chat「立账凭证 → 通知配置」按文件类型设置;排程选人只用于技术失败告警。",
|
||||
"voucherCheckNotifyFailure": "失败告警",
|
||||
"voucherCheckNotifyFailureHint": "技术失败发给下方「选择通知人员」。"
|
||||
},
|
||||
"testRun": {
|
||||
"title": "测试执行 — {name}",
|
||||
@@ -4795,7 +4797,7 @@
|
||||
"jobSubmitted": "任务已提交",
|
||||
"actionFailed": "操作失败",
|
||||
"loadFailed": "加载合同失败",
|
||||
"searchPlaceholder": "搜索合同编号、采购单号或供应商",
|
||||
"searchPlaceholder": "搜索合同编号、采购单号、供应商或申请人",
|
||||
"allStatus": "全部",
|
||||
"search": "查询",
|
||||
"ledger": "合同台账",
|
||||
@@ -4818,7 +4820,7 @@
|
||||
"pendingAlerts": "待处理预警", "processing": "已发起付款", "dataPending": "数据待确认", "paid": "已付款", "amountRatioDate": "金额 / 比例 · 日期", "applicant": "申请人", "statusLabel": "状态", "contractPrefix": "合同", "datePending": "待补充日期", "statusNormal": "正常", "statusNeedsCompletion": "待补充", "statusOverdue": "已逾期", "statusUpcoming": "即将到期", "statusActive": "进行中", "statusCompleted": "已完成",
|
||||
"totalPrefix": "共", "contractSupplier": "合同号 / 供应商", "nextAlert": "下一预警", "triggerBasis": "触发依据", "alertDate": "预警日期", "alertFirstRound": "首轮", "payDate": "付款日期", "processStatus": "处理状态", "owner": "采购负责人", "oaData": "OA 数据", "contractRule": "合同规则", "ownerDefault": "采购负责人", "workflowNo": "流程编号", "contractNoPending": "合同号待从附件解析", "synced": "已同步", "detailSubtitle": "OA 数据、付款节点与企业微信提醒记录", "backToOverview": "返回总览", "contractInfo": "OA 合同信息", "alertHistory": "预警记录", "alertRound": "第 {round} 次预警", "alertAudit": "预警发送记录", "alertAuditEmpty": "暂无预警记录", "alertNode": "付款节点", "alertScheduledAt": "计划日期", "alertSentAt": "发送时间", "alertStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "周汇总批次", "weeklyBatchesSubtitle": "查看按收件人生成的付款预警周汇总、Excel 附件及发送记录。", "weeklySend": "发送预警", "weeklyBatchSubmitted": "发送预警任务已提交", "weeklyBatchesLoadFailed": "加载周汇总批次失败", "batchNo": "批次号", "weekKey": "周次", "batchStatusLabel": "发送状态", "batchTotal": "汇总笔数", "batchExcel": "Excel 附件", "batchSentAt": "发送时间", "weeklyBatchesEmpty": "暂无周汇总批次", "weeklyPendingSummary": "本周待发送 {count} 笔 · 下次发送 {datetime}", "weeklyPendingCountOnly": "本周待发送 {count} 笔", "downloadExcel": "下载 Excel", "excelDownloadFailed": "下载预警附件失败", "batchStatus": {"pending": "待发送", "sent": "已发送", "failed": "发送失败", "processing": "处理中", "resolved": "已停止提醒"}, "backToLedger": "返回", "detailLoadFailed": "加载合同详情失败", "detailLoading": "正在加载合同详情…", "detailOverview": "合同概览", "detailAttachments": "原文附件", "detailPaymentPlan": "付款计划", "detailAlertHistory": "预警记录", "archiveDate": "合同归档日期", "archiveDateHint": "该日期为合同申请单的归档日期", "parseStatus": "解析状态", "parseIssueTitle": "解析提示", "planStatus": "计划状态", "attachmentsEmpty": "暂无已归档的合同原文附件", "downloadAttachment": "下载附件", "attachmentDownloadFailed": "下载合同附件失败", "paymentPlanEmpty": "暂无可展示的付款计划", "anchorDate": "日期依据", "nodeStatus": {"pending": "待处理", "active": "进行中", "paid": "已付", "processing": "处理中", "resolved": "已停止提醒", "upcoming": "即将到期", "notStarted": "待起算", "overdue": "已逾期", "review": "待复核"}, "reparse": "重新解析合同原文", "reparseSuccess": "已使用附件“{attachment}”重新解析", "reparseFailed": "重新解析合同失败", "reviewTitle": "待确认合同", "reviewSubtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "reviewSearchPlaceholder": "合同编号、采购编号或供应商", "reviewLoadFailed": "待确认合同加载失败", "reviewContractWorkflow": "合同号 / 流程编号", "reviewReason": "待确认原因", "reviewFallbackIssue": "解析结果待人工确认", "reviewEmpty": "暂无待确认合同"
|
||||
},
|
||||
"contractPaymentReview": {"title": "待确认合同", "subtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "searchPlaceholder": "合同编号、采购编号或供应商", "loadFailed": "待确认合同加载失败", "contractWorkflow": "合同号 / 流程编号", "reason": "待确认原因", "fallbackIssue": "解析结果待人工确认", "empty": "暂无待确认合同"},
|
||||
"contractPaymentReview": {"title": "待确认合同", "subtitle": "未匹配设备采购合同同义标题组、付款比例校验失败或关键字段冲突的合同不会进入付款预警,请下载原文核对。", "searchPlaceholder": "合同编号、采购编号、供应商或申请人", "loadFailed": "待确认合同加载失败", "contractWorkflow": "合同号 / 流程编号", "reason": "待确认原因", "fallbackIssue": "解析结果待人工确认", "empty": "暂无待确认合同"},
|
||||
"contractPaymentReparse": {"action": "重新解析合同原文", "success": "已使用附件“{attachment}”重新解析", "failed": "重新解析合同失败"},
|
||||
"procurementContract": {
|
||||
"title": "采购合同审查",
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
},
|
||||
"agentId": "应用 ID:",
|
||||
"loadingAgent": "正在加载应用...",
|
||||
"taskAgent": {
|
||||
"sessionHint": "本期不使用对话和历史会话,请从上方 Tab 查看内容。"
|
||||
},
|
||||
"thinking": "正在生成回答...",
|
||||
"stopGenerating": "停止生成",
|
||||
"disclaimer": "AI 可能会犯错,请核实重要信息。",
|
||||
|
||||
@@ -44,5 +44,22 @@
|
||||
"asc": "升序,点击切换为降序",
|
||||
"desc": "降序,点击切换为升序"
|
||||
},
|
||||
"required": "请填写必填项"
|
||||
"required": "请填写必填项",
|
||||
"userPicker": {
|
||||
"title": "选择人员",
|
||||
"subtitle": "可按部门筛选,或直接搜索姓名、工号。",
|
||||
"subtitleWithWecom": "可按部门筛选,或直接搜索姓名、工号。未绑定企微的人可勾选,发送时会跳过。",
|
||||
"searchPlaceholder": "搜索姓名 / 工号",
|
||||
"allDepartments": "全部",
|
||||
"unknownDepartment": "未分配部门",
|
||||
"selectDepartment": "全选本部门",
|
||||
"selectVisible": "全选当前列表",
|
||||
"select": "选择",
|
||||
"empty": "没有匹配的人员",
|
||||
"noneSelected": "尚未选择",
|
||||
"emptyTrigger": "未选择",
|
||||
"confirmCount": "确定({count})",
|
||||
"wecomBound": "已绑企微",
|
||||
"wecomUnbound": "未绑定企微"
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,8 @@
|
||||
"CHAT.USER_ATTACHMENTS_LIMIT_EXCEEDED": "附件数量超过上限(最多 200 个),请减少后重试。",
|
||||
"CONTRACT_PAYMENT_FORBIDDEN": "你没有合同付款预警的访问权限。",
|
||||
"CONTRACT_PAYMENT_ADMIN_REQUIRED": "仅管理员可执行合同付款预警的同步、扫描或发送操作。",
|
||||
"VOUCHER_CHECK_FORBIDDEN": "你没有立账凭证检核的访问权限。",
|
||||
"VOUCHER_CHECK_ADMIN_REQUIRED": "仅管理员可强制重检或修改立账凭证通知配置。",
|
||||
"SHIPPING_TASK_SELECTION_INVALID": "请选择 1 到 100 个发货任务。",
|
||||
"SHIPPING_TASK_DELETE_REASON_REQUIRED": "删除或作废任务必须填写原因。",
|
||||
"SHIPPING_TASK_EXTERNAL_VOID_BLOCKED": "任务正在外部上传或已上传,只能归档,不能作废或删除。",
|
||||
|
||||
@@ -939,6 +939,20 @@
|
||||
"stepDone": "检核完成",
|
||||
"tabTasks": "检核任务",
|
||||
"tabNotifications": "企微发送记录",
|
||||
"tabNotifyConfig": "通知配置",
|
||||
"notifyConfigTitle": "按文件类型配置缺件接收人",
|
||||
"notifyConfigSubtitle": "六类文件可由不同部门接收。每人只收到自己负责且本批缺失的类型;完整明细仍以 Excel 为准。排程里的「启用通知」是总开关,选人只用于技术失败告警。",
|
||||
"notifyConfigSave": "保存",
|
||||
"notifyConfigSaved": "通知配置已保存",
|
||||
"notifyConfigLoadFailed": "加载通知配置失败",
|
||||
"notifyConfigSaveFailed": "保存通知配置失败",
|
||||
"notifyConfigSelectUsers": "选择接收人…",
|
||||
"notifyConfigPickerTitle": "选择接收人",
|
||||
"notifyConfigEmptyUsers": "未选择接收人",
|
||||
"notifyConfigNoUsers": "没有匹配的用户",
|
||||
"notifyConfigWecomUnbound": "未绑定企微",
|
||||
"notifyConfigFolder": "类型目录 {folder}",
|
||||
"notifyConfigUpdatedAt": "最近保存 {time}",
|
||||
"notifyEmpty": "暂无企业微信发送记录",
|
||||
"notifyLoadFailed": "加载发送记录失败",
|
||||
"notifyStatus": "发送状态",
|
||||
|
||||
@@ -2253,7 +2253,9 @@
|
||||
"voucherCheckScope": "帳套",
|
||||
"voucherCheckProfile": "業務方 Profile",
|
||||
"voucherCheckNotifyMissing": "缺資料通知",
|
||||
"voucherCheckNotifyFailure": "失敗告警"
|
||||
"voucherCheckNotifyMissingHint": "總開關。缺件接收人請到 Chat「立帳憑證 → 通知設定」依檔案類型設定;排程選人只用於技術失敗告警。",
|
||||
"voucherCheckNotifyFailure": "失敗告警",
|
||||
"voucherCheckNotifyFailureHint": "技術失敗會發給下方「選擇通知人員」。"
|
||||
},
|
||||
"status": {
|
||||
"all": "全部狀態",
|
||||
@@ -4672,11 +4674,11 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "合約付款預警", "subtitle": "同步 OA 合約、驗收和廠商預付款請款作業,按三輪規則通知採購職位", "sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看台帳。", "sync": "同步 OA 資料", "forceSync": "強制覆蓋 OA 欄位", "forceSyncConfirm": "將以本次 OA 回傳的非空欄位覆蓋既有 OA 資料,並記錄變更稽核。是否繼續?", "reparseExisting": "批量重新解析既有合約", "reparseExistingConfirm": "將使用已歸檔的合約附件依目前規則更新所有既有合約的解析結果,不會同步或覆蓋 OA 欄位。是否繼續?", "scanAlerts": "掃描產生預警", "jobSubmitted": "工作已提交", "actionFailed": "操作失敗", "loadFailed": "載入合約失敗", "searchPlaceholder": "搜尋合約編號、採購單號或供應商", "allStatus": "全部", "search": "查詢", "ledger": "合約台帳", "items": "筆", "empty": "暫無合約資料", "purchaseOrder": "採購單號", "supplier": "供應商", "amount": "合約金額", "deliveryDate": "交貨期限", "timeline": "付款計畫時間線", "notAvailable": "—", "stats": {"contracts": "合約總數", "pendingParse": "待處理合約", "readyPlans": "計畫已產生", "alerts": "待預警節點"}, "ledgerFocus": {"due": "即將到期", "dueHint": "7日內", "overdue": "逾期未付", "active": "進行中", "dueThisMonth": "本月應付", "dueThisMonthHint": "本自然月"}, "status": {"completed": "已完成", "needs_review": "待覆核", "pending": "待解析"}, "stateLabel": {"parsed": "已解析", "needs_review": "待複核", "pending": "待解析", "active": "已生效"}, "nodeType": {"prepayment": "預付款", "shipment": "出貨款", "acceptance": "驗收款", "warranty": "質保款"}, "ruleConfirmed": "已確定", "prepaymentRule": "合約歸檔後第 7/14/21 天預警;請款以 OA 廠商預付款請款作業為準。", "shipmentRule": "交貨期限前 7 天、到期日、到期後 14 天預警;請款以 OA 廠商預付款請款作業為準。", "acceptanceRule": "驗收歸檔後第 30/40/60 天預警;質保款在質保到期前 7 天、到期日、到期後 14 天預警。", "pendingAlerts": "待處理預警", "processing": "已發起付款", "dataPending": "資料待確認", "paid": "已付款", "amountRatioDate": "金額 / 比例 · 日期", "applicant": "申請人", "statusLabel": "狀態", "contractPrefix": "合約", "datePending": "待補充日期", "statusNormal": "正常", "statusNeedsCompletion": "待補充", "statusOverdue": "已逾期", "statusUpcoming": "即將到期", "statusActive": "進行中", "statusCompleted": "已完成", "totalPrefix": "共", "contractSupplier": "合約號 / 供應商", "nextAlert": "下一預警", "triggerBasis": "觸發依據", "alertDate": "預警日期", "alertFirstRound": "首輪", "payDate": "付款日期", "processStatus": "處理狀態", "owner": "採購負責人", "oaData": "OA 資料", "contractRule": "合約規則", "ownerDefault": "採購負責人", "workflowNo": "流程編號", "contractNoPending": "合約號待從附件解析", "synced": "已同步", "detailSubtitle": "OA 資料、付款節點與企業微信提醒記錄", "backToOverview": "返回總覽", "contractInfo": "OA 合約資訊", "alertHistory": "預警記錄", "alertRound": "第 {round} 次預警", "alertAudit": "預警發送記錄", "alertAuditEmpty": "暫無預警記錄", "alertNode": "付款節點", "alertScheduledAt": "計畫日期", "alertSentAt": "發送時間", "alertStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "週彙總批次", "weeklyBatchesSubtitle": "查看依收件人產生的付款預警週彙總、Excel 附件與發送記錄。", "weeklySend": "傳送預警", "weeklyBatchSubmitted": "發送預警任務已提交", "weeklyBatchesLoadFailed": "載入週彙總批次失敗", "batchNo": "批次號", "weekKey": "週次", "batchStatusLabel": "發送狀態", "batchTotal": "彙總筆數", "batchExcel": "Excel 附件", "batchSentAt": "發送時間", "weeklyBatchesEmpty": "暫無週彙總批次", "weeklyPendingSummary": "本週待發送 {count} 筆 · 下次發送 {datetime}", "weeklyPendingCountOnly": "本週待發送 {count} 筆", "downloadExcel": "下載 Excel", "excelDownloadFailed": "下載預警附件失敗", "batchStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗", "processing": "處理中", "resolved": "已停止提醒"}, "backToLedger": "返回", "detailLoadFailed": "載入合約詳情失敗", "detailLoading": "正在載入合約詳情…", "detailOverview": "合約概覽", "detailAttachments": "原文附件", "detailPaymentPlan": "付款計畫", "detailAlertHistory": "預警記錄", "archiveDate": "合約歸檔日期", "archiveDateHint": "該日期為合約申請單的歸檔日期", "parseStatus": "解析狀態", "parseIssueTitle": "解析提示", "planStatus": "計畫狀態", "attachmLine truncated
|
||||
"title": "合約付款預警", "subtitle": "同步 OA 合約、驗收和廠商預付款請款作業,按三輪規則通知採購職位", "sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看台帳。", "sync": "同步 OA 資料", "forceSync": "強制覆蓋 OA 欄位", "forceSyncConfirm": "將以本次 OA 回傳的非空欄位覆蓋既有 OA 資料,並記錄變更稽核。是否繼續?", "reparseExisting": "批量重新解析既有合約", "reparseExistingConfirm": "將使用已歸檔的合約附件依目前規則更新所有既有合約的解析結果,不會同步或覆蓋 OA 欄位。是否繼續?", "scanAlerts": "掃描產生預警", "jobSubmitted": "工作已提交", "actionFailed": "操作失敗", "loadFailed": "載入合約失敗", "searchPlaceholder": "搜尋合約編號、採購單號、供應商或申請人", "allStatus": "全部", "search": "查詢", "ledger": "合約台帳", "items": "筆", "empty": "暫無合約資料", "purchaseOrder": "採購單號", "supplier": "供應商", "amount": "合約金額", "deliveryDate": "交貨期限", "timeline": "付款計畫時間線", "notAvailable": "—", "stats": {"contracts": "合約總數", "pendingParse": "待處理合約", "readyPlans": "計畫已產生", "alerts": "待預警節點"}, "ledgerFocus": {"due": "即將到期", "dueHint": "7日內", "overdue": "逾期未付", "active": "進行中", "dueThisMonth": "本月應付", "dueThisMonthHint": "本自然月"}, "status": {"completed": "已完成", "needs_review": "待覆核", "pending": "待解析"}, "stateLabel": {"parsed": "已解析", "needs_review": "待複核", "pending": "待解析", "active": "已生效"}, "nodeType": {"prepayment": "預付款", "shipment": "出貨款", "acceptance": "驗收款", "warranty": "質保款"}, "ruleConfirmed": "已確定", "prepaymentRule": "合約歸檔後第 7/14/21 天預警;請款以 OA 廠商預付款請款作業為準。", "shipmentRule": "交貨期限前 7 天、到期日、到期後 14 天預警;請款以 OA 廠商預付款請款作業為準。", "acceptanceRule": "驗收歸檔後第 30/40/60 天預警;質保款在質保到期前 7 天、到期日、到期後 14 天預警。", "pendingAlerts": "待處理預警", "processing": "已發起付款", "dataPending": "資料待確認", "paid": "已付款", "amountRatioDate": "金額 / 比例 · 日期", "applicant": "申請人", "statusLabel": "狀態", "contractPrefix": "合約", "datePending": "待補充日期", "statusNormal": "正常", "statusNeedsCompletion": "待補充", "statusOverdue": "已逾期", "statusUpcoming": "即將到期", "statusActive": "進行中", "statusCompleted": "已完成", "totalPrefix": "共", "contractSupplier": "合約號 / 供應商", "nextAlert": "下一預警", "triggerBasis": "觸發依據", "alertDate": "預警日期", "alertFirstRound": "首輪", "payDate": "付款日期", "processStatus": "處理狀態", "owner": "採購負責人", "oaData": "OA 資料", "contractRule": "合約規則", "ownerDefault": "採購負責人", "workflowNo": "流程編號", "contractNoPending": "合約號待從附件解析", "synced": "已同步", "detailSubtitle": "OA 資料、付款節點與企業微信提醒記錄", "backToOverview": "返回總覽", "contractInfo": "OA 合約資訊", "alertHistory": "預警記錄", "alertRound": "第 {round} 次預警", "alertAudit": "預警發送記錄", "alertAuditEmpty": "暫無預警記錄", "alertNode": "付款節點", "alertScheduledAt": "計畫日期", "alertSentAt": "發送時間", "alertStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗"}, "roundValue": "第 {round} 次", "weeklyBatchesTitle": "週彙總批次", "weeklyBatchesSubtitle": "查看依收件人產生的付款預警週彙總、Excel 附件與發送記錄。", "weeklySend": "傳送預警", "weeklyBatchSubmitted": "發送預警任務已提交", "weeklyBatchesLoadFailed": "載入週彙總批次失敗", "batchNo": "批次號", "weekKey": "週次", "batchStatusLabel": "發送狀態", "batchTotal": "彙總筆數", "batchExcel": "Excel 附件", "batchSentAt": "發送時間", "weeklyBatchesEmpty": "暫無週彙總批次", "weeklyPendingSummary": "本週待發送 {count} 筆 · 下次發送 {datetime}", "weeklyPendingCountOnly": "本週待發送 {count} 筆", "downloadExcel": "下載 Excel", "excelDownloadFailed": "下載預警附件失敗", "batchStatus": {"pending": "待發送", "sent": "已發送", "failed": "發送失敗", "processing": "處理中", "resolved": "已停止提醒"}, "backToLedger": "返回", "detailLoadFailed": "載入合約詳情失敗", "detailLoading": "正在載入合約詳情…", "detailOverview": "合約概覽", "detailAttachments": "原文附件", "detailPaymentPlan": "付款計畫", "detailAlertHistory": "預警記錄", "archiveDate": "合約歸檔日期", "archiveDateHint": "該日期為合約申請單的歸檔日期", "parseStatus": "解析狀態", "parseIssueTitle": "解析提示", "planStatus": "計畫狀Line truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號或供應商", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReparse": {"action": "重新解析合約原文", "success": "已使用附件“{attachment}”重新解析", "failed": "重新解析合約失敗"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號或供應商", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號、供應商或申請人", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"procurementContract": {
|
||||
"title": "採購合同審查",
|
||||
"subtitle": "維護標準合同模板、風險紅線規則並查看審查歷史",
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
},
|
||||
"agentId": "應用 ID:",
|
||||
"loadingAgent": "正在加載應用...",
|
||||
"taskAgent": {
|
||||
"sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看內容。"
|
||||
},
|
||||
"thinking": "正在生成回答...",
|
||||
"stopGenerating": "停止生成",
|
||||
"disclaimer": "AI 可能會犯錯,請核實重要信息。",
|
||||
|
||||
@@ -44,5 +44,22 @@
|
||||
"asc": "升序,點擊切換為降序",
|
||||
"desc": "降序,點擊切換為升序"
|
||||
},
|
||||
"required": "請填寫必填欄位"
|
||||
"required": "請填寫必填欄位",
|
||||
"userPicker": {
|
||||
"title": "選擇人員",
|
||||
"subtitle": "可依部門篩選,或直接搜尋姓名、工號。",
|
||||
"subtitleWithWecom": "可依部門篩選,或直接搜尋姓名、工號。未綁定企微的人可勾選,發送時會略過。",
|
||||
"searchPlaceholder": "搜尋姓名 / 工號",
|
||||
"allDepartments": "全部",
|
||||
"unknownDepartment": "未分配部門",
|
||||
"selectDepartment": "全選本部門",
|
||||
"selectVisible": "全選目前列表",
|
||||
"select": "選擇",
|
||||
"empty": "沒有符合的人員",
|
||||
"noneSelected": "尚未選擇",
|
||||
"emptyTrigger": "未選擇",
|
||||
"confirmCount": "確定({count})",
|
||||
"wecomBound": "已綁企微",
|
||||
"wecomUnbound": "未綁定企微"
|
||||
}
|
||||
}
|
||||
@@ -135,6 +135,8 @@
|
||||
"CHAT.USER_ATTACHMENTS_LIMIT_EXCEEDED": "附件數量超過上限(最多 200 個),請減少後重試。",
|
||||
"CONTRACT_PAYMENT_FORBIDDEN": "你沒有合約付款預警的存取權限。",
|
||||
"CONTRACT_PAYMENT_ADMIN_REQUIRED": "僅管理員可執行合約付款預警的同步、掃描或發送操作。",
|
||||
"VOUCHER_CHECK_FORBIDDEN": "你沒有立帳憑證檢核的存取權限。",
|
||||
"VOUCHER_CHECK_ADMIN_REQUIRED": "僅管理員可強制重檢或修改立帳憑證通知設定。",
|
||||
"SHIPPING_TASK_SELECTION_INVALID": "請選擇 1 到 100 個發貨任務。",
|
||||
"SHIPPING_TASK_DELETE_REASON_REQUIRED": "刪除或作廢任務必須填寫原因。",
|
||||
"SHIPPING_TASK_EXTERNAL_VOID_BLOCKED": "任務正在外部上傳或已上傳,只能歸檔,不能作廢或刪除。",
|
||||
|
||||
@@ -939,6 +939,20 @@
|
||||
"stepDone": "檢核完成",
|
||||
"tabTasks": "檢核任務",
|
||||
"tabNotifications": "企微發送紀錄",
|
||||
"tabNotifyConfig": "通知設定",
|
||||
"notifyConfigTitle": "依檔案類型設定缺件接收人",
|
||||
"notifyConfigSubtitle": "六類文件可由不同部門接收。每人只會收到自己負責且本批缺失的類型;完整明細仍以 Excel 為準。排程裡的「啟用通知」是總開關,選人只用於技術失敗告警。",
|
||||
"notifyConfigSave": "儲存",
|
||||
"notifyConfigSaved": "通知設定已儲存",
|
||||
"notifyConfigLoadFailed": "載入通知設定失敗",
|
||||
"notifyConfigSaveFailed": "儲存通知設定失敗",
|
||||
"notifyConfigSelectUsers": "選擇接收人…",
|
||||
"notifyConfigPickerTitle": "選擇接收人",
|
||||
"notifyConfigEmptyUsers": "未選擇接收人",
|
||||
"notifyConfigNoUsers": "沒有符合的使用者",
|
||||
"notifyConfigWecomUnbound": "未綁定企微",
|
||||
"notifyConfigFolder": "類型目錄 {folder}",
|
||||
"notifyConfigUpdatedAt": "最近儲存 {time}",
|
||||
"notifyEmpty": "暫無企業微信發送紀錄",
|
||||
"notifyLoadFailed": "載入發送紀錄失敗",
|
||||
"notifyStatus": "發送狀態",
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* shared/components/UserPickerDialog.vue
|
||||
* 用途:跨业务公共选人弹窗:左侧部门、右侧搜索/勾选、底部已选与确定。
|
||||
* 依赖:vue-i18n、dialog-overlay / dialog-panel、userPicker.types / userPicker.utils。
|
||||
* 逻辑:父组件传入候选人并 v-model 控制显隐;确定才回写 selectedIds,取消不改已保存选择。
|
||||
* 不自行拉用户列表,便于凭证检核、排程告警等各自提供数据源。
|
||||
*/
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import {
|
||||
USER_PICKER_ALL_DEPT,
|
||||
USER_PICKER_NONE_DEPT,
|
||||
type UserPickerPerson,
|
||||
} from '@/shared/types/userPicker.types';
|
||||
import {
|
||||
filterUserPickerPeople,
|
||||
listUserPickerDepartments,
|
||||
userPickerLabel,
|
||||
} from '@/shared/utils/userPicker.utils';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
users: UserPickerPerson[];
|
||||
selectedIds: number[];
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
/** 为 true 强制展示企微标记;为 false 隐藏;缺省时有 wecom_bound 字段才展示 */
|
||||
showWecomStatus?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
users: () => [],
|
||||
selectedIds: () => [],
|
||||
title: '',
|
||||
subtitle: '',
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm', ids: number[]): void;
|
||||
(e: 'cancel'): void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const query = ref('');
|
||||
const departmentKey = ref(USER_PICKER_ALL_DEPT);
|
||||
const draftIds = ref<number[]>([]);
|
||||
|
||||
const userMap = computed(() => {
|
||||
const next = new Map<number, UserPickerPerson>();
|
||||
for (const user of props.users) next.set(user.id, user);
|
||||
return next;
|
||||
});
|
||||
|
||||
const departments = computed(() => listUserPickerDepartments(props.users));
|
||||
|
||||
const visibleUsers = computed(() =>
|
||||
filterUserPickerPeople(props.users, {
|
||||
departmentKey: departmentKey.value,
|
||||
query: query.value,
|
||||
}),
|
||||
);
|
||||
|
||||
const showWecom = computed(() => {
|
||||
if (props.showWecomStatus === true) return true;
|
||||
if (props.showWecomStatus === false) return false;
|
||||
return props.users.some((user) => typeof user.wecom_bound === 'boolean');
|
||||
});
|
||||
|
||||
const resolvedTitle = computed(() => props.title || t('common.userPicker.title'));
|
||||
const resolvedSubtitle = computed(() => {
|
||||
if (props.subtitle) return props.subtitle;
|
||||
return showWecom.value ? t('common.userPicker.subtitleWithWecom') : t('common.userPicker.subtitle');
|
||||
});
|
||||
|
||||
const visibleAllSelected = computed(() => {
|
||||
const ids = visibleUsers.value.map((user) => user.id);
|
||||
return ids.length > 0 && ids.every((id) => draftIds.value.includes(id));
|
||||
});
|
||||
|
||||
/**
|
||||
* 「全部」或有搜索时用「全选当前列表」;点了具体部门且未搜索时用「全选本部门」。
|
||||
*/
|
||||
const selectVisibleLabel = computed(() => {
|
||||
const scopedToDept =
|
||||
departmentKey.value !== USER_PICKER_ALL_DEPT && !String(query.value || '').trim();
|
||||
return t(scopedToDept ? 'common.userPicker.selectDepartment' : 'common.userPicker.selectVisible');
|
||||
});
|
||||
|
||||
/**
|
||||
* 把传入 id 收成去重正整数,打开弹窗时作为草稿。
|
||||
*/
|
||||
function normalizeIds(ids: number[]): number[] {
|
||||
const seen = new Set<number>();
|
||||
const next: number[] = [];
|
||||
for (const raw of ids || []) {
|
||||
const id = Number(raw);
|
||||
if (!Number.isInteger(id) || id <= 0 || seen.has(id)) continue;
|
||||
seen.add(id);
|
||||
next.push(id);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门筛选项展示名:全部 / 未分配 / 具名部门。
|
||||
*/
|
||||
function departmentLabel(key: string): string {
|
||||
if (key === USER_PICKER_ALL_DEPT) return t('common.userPicker.allDepartments');
|
||||
if (key === USER_PICKER_NONE_DEPT) return t('common.userPicker.unknownDepartment');
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员第二行:工号 · 部门。
|
||||
*/
|
||||
function personMeta(person: UserPickerPerson): string {
|
||||
const emp = String(person.employee_id || '').trim();
|
||||
const dept = String(person.department || '').trim() || t('common.userPicker.unknownDepartment');
|
||||
return [emp, dept].filter(Boolean).join(' · ');
|
||||
}
|
||||
|
||||
/**
|
||||
* 勾选或取消单个候选人,保留点击顺序。
|
||||
*/
|
||||
function toggleUser(userId: number): void {
|
||||
if (draftIds.value.includes(userId)) {
|
||||
draftIds.value = draftIds.value.filter((id) => id !== userId);
|
||||
return;
|
||||
}
|
||||
draftIds.value = [...draftIds.value, userId];
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选或取消当前可见列表(受部门与搜索约束)。
|
||||
*/
|
||||
function toggleVisibleSelection(): void {
|
||||
const ids = visibleUsers.value.map((user) => user.id);
|
||||
if (!ids.length) return;
|
||||
if (visibleAllSelected.value) {
|
||||
const drop = new Set(ids);
|
||||
draftIds.value = draftIds.value.filter((id) => !drop.has(id));
|
||||
return;
|
||||
}
|
||||
const seen = new Set(draftIds.value);
|
||||
draftIds.value = [...draftIds.value, ...ids.filter((id) => !seen.has(id))];
|
||||
}
|
||||
|
||||
function closeDialog(): void {
|
||||
emit('update:modelValue', false);
|
||||
}
|
||||
|
||||
function handleCancel(): void {
|
||||
emit('cancel');
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 把草稿 id 回写给父组件后再关闭。
|
||||
*/
|
||||
function handleConfirm(): void {
|
||||
emit('confirm', [...draftIds.value]);
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
function handleEscKey(event: KeyboardEvent): void {
|
||||
if (event.key === 'Escape' && props.modelValue) handleCancel();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
draftIds.value = normalizeIds(props.selectedIds);
|
||||
departmentKey.value = USER_PICKER_ALL_DEPT;
|
||||
query.value = '';
|
||||
document.addEventListener('keydown', handleEscKey);
|
||||
return;
|
||||
}
|
||||
document.removeEventListener('keydown', handleEscKey);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('keydown', handleEscKey);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="modelValue"
|
||||
class="dialog-overlay z-[120] items-center"
|
||||
@click.self="handleCancel"
|
||||
>
|
||||
<div
|
||||
class="dialog-panel flex max-h-[min(620px,calc(100vh-40px))] w-full max-w-[760px] overflow-hidden"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3 border-b border-default px-5 py-4">
|
||||
<div class="min-w-0">
|
||||
<h3 class="text-base font-semibold text-primary">{{ resolvedTitle }}</h3>
|
||||
<p class="mt-1 text-xs text-muted">{{ resolvedSubtitle }}</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 rounded-lg px-1.5 text-xl leading-none text-muted hover:bg-surface-soft hover:text-primary"
|
||||
:aria-label="t('common.close')"
|
||||
@click="handleCancel"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex min-h-0 flex-1 flex-col md:flex-row">
|
||||
<aside class="max-h-40 shrink-0 overflow-auto border-b border-default bg-surface-soft md:max-h-none md:w-[200px] md:border-b-0 md:border-r">
|
||||
<button
|
||||
v-for="dept in departments"
|
||||
:key="dept.key"
|
||||
type="button"
|
||||
class="flex w-full items-center justify-between border-l-4 px-3 py-2.5 text-left text-sm text-secondary"
|
||||
:class="departmentKey === dept.key
|
||||
? 'border-brand-600 bg-surface font-semibold text-brand-600'
|
||||
: 'border-transparent hover:bg-surface'"
|
||||
@click="departmentKey = dept.key"
|
||||
>
|
||||
<span>{{ departmentLabel(dept.key) }}</span>
|
||||
<span class="text-xs font-medium text-muted">{{ dept.count }}</span>
|
||||
</button>
|
||||
</aside>
|
||||
|
||||
<section class="flex min-h-0 min-w-0 flex-1 flex-col">
|
||||
<div class="flex items-center gap-2 border-b border-default px-3 py-2.5">
|
||||
<input
|
||||
v-model="query"
|
||||
type="search"
|
||||
class="input-field min-w-0 flex-1"
|
||||
:placeholder="t('common.userPicker.searchPlaceholder')"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 whitespace-nowrap text-xs font-semibold text-brand-600 hover:text-brand-700 disabled:opacity-40"
|
||||
:disabled="visibleUsers.length === 0"
|
||||
@click="toggleVisibleSelection"
|
||||
>
|
||||
{{ selectVisibleLabel }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="min-h-[220px] flex-1 overflow-auto">
|
||||
<button
|
||||
v-for="user in visibleUsers"
|
||||
:key="user.id"
|
||||
type="button"
|
||||
class="flex w-full items-center gap-2.5 border-b border-default px-3 py-2.5 text-left hover:bg-surface-soft"
|
||||
:class="draftIds.includes(user.id) ? 'bg-blue-50/70' : 'bg-surface'"
|
||||
@click="toggleUser(user.id)"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="pointer-events-none h-3.5 w-3.5 rounded text-brand-600"
|
||||
:checked="draftIds.includes(user.id)"
|
||||
tabindex="-1"
|
||||
readonly
|
||||
/>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block text-sm font-medium text-primary">{{ userPickerLabel(user) }}</span>
|
||||
<span class="block text-xs text-muted">{{ personMeta(user) }}</span>
|
||||
</span>
|
||||
<span
|
||||
v-if="showWecom && user.wecom_bound"
|
||||
class="shrink-0 text-[11px] font-semibold text-emerald-700"
|
||||
>
|
||||
{{ t('common.userPicker.wecomBound') }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="showWecom"
|
||||
class="shrink-0 text-[11px] font-semibold text-amber-700"
|
||||
>
|
||||
{{ t('common.userPicker.wecomUnbound') }}
|
||||
</span>
|
||||
</button>
|
||||
<div v-if="visibleUsers.length === 0" class="px-3 py-10 text-center text-sm text-muted">
|
||||
{{ t('common.userPicker.empty') }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3 border-t border-default bg-surface-soft px-5 py-3">
|
||||
<div class="flex min-w-0 flex-1 flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="userId in draftIds"
|
||||
:key="userId"
|
||||
class="inline-flex items-center gap-1 rounded-lg bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700"
|
||||
>
|
||||
{{ userPickerLabel(userMap.get(userId), userId) }}
|
||||
<button
|
||||
type="button"
|
||||
class="text-blue-400 hover:text-blue-600"
|
||||
@click="toggleUser(userId)"
|
||||
>✕</button>
|
||||
</span>
|
||||
<span v-if="draftIds.length === 0" class="text-sm text-muted">
|
||||
{{ t('common.userPicker.noneSelected') }}
|
||||
</span>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary btn-sm shrink-0" @click="handleCancel">
|
||||
{{ t('common.cancel') }}
|
||||
</button>
|
||||
<button type="button" class="btn-primary btn-sm shrink-0" @click="handleConfirm">
|
||||
{{ t('common.userPicker.confirmCount', { count: draftIds.length }) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* shared/types/userPicker.types.ts
|
||||
* 用途:公共选人弹窗的人员数据结构,供各业务传入自己的候选人列表。
|
||||
* 依赖:无。
|
||||
* 逻辑:UserPickerDialog / userPicker.utils 共用;wecom_bound 可选,缺省时不展示企微标记。
|
||||
*/
|
||||
export interface UserPickerPerson {
|
||||
id: number;
|
||||
username: string;
|
||||
real_name?: string | null;
|
||||
employee_id?: string | null;
|
||||
department?: string | null;
|
||||
wecom_bound?: boolean;
|
||||
}
|
||||
|
||||
export const USER_PICKER_ALL_DEPT = '__all__';
|
||||
export const USER_PICKER_NONE_DEPT = '__none__';
|
||||
@@ -11,6 +11,7 @@ export const AGENT_CODE_SHIPPING_NOTICE = 'shipping_notice';
|
||||
export const AGENT_CODE_FILE_CHECK = 'file_check';
|
||||
export const AGENT_CODE_PROCUREMENT_CONTRACT_REVIEW = 'procurement_contract_review';
|
||||
export const AGENT_CODE_CONTRACT_PAYMENT = 'contract_payment';
|
||||
export const AGENT_CODE_VOUCHER_CHECK = 'voucher_check';
|
||||
export const AGENT_CODE_IN_TRANSIT_TRANSFER = 'in_transit_transfer';
|
||||
|
||||
export interface AgentRegistryCapabilities {
|
||||
@@ -243,6 +244,11 @@ export function isContractPaymentAgent(agent: AgentLike): boolean {
|
||||
return resolveAgentCode(agent) === AGENT_CODE_CONTRACT_PAYMENT;
|
||||
}
|
||||
|
||||
/** 是否为立账凭证检核 Agent(agent_code=voucher_check)。 */
|
||||
export function isVoucherCheckAgent(agent: AgentLike): boolean {
|
||||
return resolveAgentCode(agent) === AGENT_CODE_VOUCHER_CHECK;
|
||||
}
|
||||
|
||||
/** 是否启用本地请假表单(后端 leave_feature_enabled)。 */
|
||||
export function canUseLeaveFeature(agent: AgentLike): boolean {
|
||||
return Boolean(agent?.leave_feature_enabled);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* shared/utils/userPicker.utils.test.ts
|
||||
* 用途:锁定公共选人弹窗的部门分组与筛选规则。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
USER_PICKER_ALL_DEPT,
|
||||
USER_PICKER_NONE_DEPT,
|
||||
type UserPickerPerson,
|
||||
} from '@/shared/types/userPicker.types';
|
||||
import {
|
||||
filterUserPickerPeople,
|
||||
listUserPickerDepartments,
|
||||
userPickerLabel,
|
||||
} from './userPicker.utils';
|
||||
|
||||
const people: UserPickerPerson[] = [
|
||||
{ id: 1, username: 'a', real_name: '钟淑惠', employee_id: '0100004', department: '财务部' },
|
||||
{ id: 2, username: 'b', real_name: '成秋兰', employee_id: '0203036', department: '关务部' },
|
||||
{ id: 3, username: 'c', real_name: '刘江', employee_id: '07090745', department: ' ' },
|
||||
];
|
||||
|
||||
describe('userPickerLabel', () => {
|
||||
it('prefers real name and appends employee id', () => {
|
||||
expect(userPickerLabel(people[0])).toBe('钟淑惠(0100004)');
|
||||
expect(userPickerLabel(undefined, 9)).toBe('9');
|
||||
});
|
||||
});
|
||||
|
||||
describe('listUserPickerDepartments', () => {
|
||||
it('puts all first, named departments next, and unnamed last', () => {
|
||||
expect(listUserPickerDepartments(people)).toEqual([
|
||||
{ key: USER_PICKER_ALL_DEPT, count: 3 },
|
||||
{ key: '财务部', count: 1 },
|
||||
{ key: '关务部', count: 1 },
|
||||
{ key: USER_PICKER_NONE_DEPT, count: 1 },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('filterUserPickerPeople', () => {
|
||||
it('filters by department and keyword', () => {
|
||||
expect(filterUserPickerPeople(people, { departmentKey: '财务部' }).map((row) => row.id)).toEqual([1]);
|
||||
expect(filterUserPickerPeople(people, { query: '0203' }).map((row) => row.id)).toEqual([2]);
|
||||
expect(filterUserPickerPeople(people, { departmentKey: USER_PICKER_NONE_DEPT }).map((row) => row.id)).toEqual([3]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* shared/utils/userPicker.utils.ts
|
||||
* 用途:公共选人弹窗的展示名、部门分组与筛选。
|
||||
* 依赖:userPicker.types。
|
||||
* 逻辑:UserPickerDialog 调用;部门为空归入 USER_PICKER_NONE_DEPT。
|
||||
*/
|
||||
import {
|
||||
USER_PICKER_ALL_DEPT,
|
||||
USER_PICKER_NONE_DEPT,
|
||||
type UserPickerPerson,
|
||||
} from '@/shared/types/userPicker.types';
|
||||
|
||||
export interface UserPickerDepartment {
|
||||
key: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员展示名:实名优先,附工号。
|
||||
*/
|
||||
export function userPickerLabel(person?: UserPickerPerson | null, fallbackId?: number): string {
|
||||
if (!person) return String(fallbackId || '');
|
||||
const name = String(person.real_name || person.username || '').trim();
|
||||
const emp = String(person.employee_id || '').trim();
|
||||
return emp ? `${name}(${emp})` : name || String(person.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把用户部门归一成筛选键:空部门用 USER_PICKER_NONE_DEPT。
|
||||
*/
|
||||
export function userPickerDepartmentKey(person: UserPickerPerson): string {
|
||||
return String(person.department || '').trim() || USER_PICKER_NONE_DEPT;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计部门列表:全部在前,具名部门按名称排序,未分配部门垫底。
|
||||
*/
|
||||
export function listUserPickerDepartments(users: UserPickerPerson[]): UserPickerDepartment[] {
|
||||
const counts = new Map<string, number>();
|
||||
for (const user of users) {
|
||||
const key = userPickerDepartmentKey(user);
|
||||
counts.set(key, (counts.get(key) || 0) + 1);
|
||||
}
|
||||
const named = [...counts.keys()]
|
||||
.filter((key) => key !== USER_PICKER_NONE_DEPT)
|
||||
.sort((a, b) => a.localeCompare(b, 'zh-CN'));
|
||||
const items: UserPickerDepartment[] = [
|
||||
{ key: USER_PICKER_ALL_DEPT, count: users.length },
|
||||
...named.map((key) => ({ key, count: counts.get(key) || 0 })),
|
||||
];
|
||||
const unnamed = counts.get(USER_PICKER_NONE_DEPT) || 0;
|
||||
if (unnamed) items.push({ key: USER_PICKER_NONE_DEPT, count: unnamed });
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按部门与关键字筛选候选人。
|
||||
* @param options.departmentKey - USER_PICKER_ALL_DEPT 表示不限部门
|
||||
* @param options.query - 匹配姓名、用户名、工号、部门
|
||||
*/
|
||||
export function filterUserPickerPeople(
|
||||
users: UserPickerPerson[],
|
||||
options?: { departmentKey?: string; query?: string },
|
||||
): UserPickerPerson[] {
|
||||
const departmentKey = options?.departmentKey || USER_PICKER_ALL_DEPT;
|
||||
const keyword = String(options?.query || '').trim().toLowerCase();
|
||||
return users.filter((user) => {
|
||||
if (departmentKey !== USER_PICKER_ALL_DEPT && userPickerDepartmentKey(user) !== departmentKey) {
|
||||
return false;
|
||||
}
|
||||
if (!keyword) return true;
|
||||
const hay = [
|
||||
user.real_name,
|
||||
user.username,
|
||||
user.employee_id,
|
||||
user.department,
|
||||
].join(' ').toLowerCase();
|
||||
return hay.includes(keyword);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user