Merge branch 'dev' into test
This commit is contained in:
commit
697e2c55c0
121 files changed
+6539
-697
No files matched your search
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* app/router/guards.ts
|
||||
* 全局路由守卫:认证、权限、旧 URL 兼容、document.title。
|
||||
* 依赖:vue-router、config、auth.store、i18n、adminModulePath、isPublicPath、useMessage、contract-payment 权限常量。
|
||||
* 依赖:vue-router、config、auth.store、i18n、adminModulePath、isPublicPath、useMessage。
|
||||
* 逻辑:beforeEach 做登录/管理员/功能权限校验,未登录跳登录页时携带 redirect 深链参数(登录后原样回跳);
|
||||
* afterEach 将 meta.title(i18n key 或字面量)解析为浏览器标题。
|
||||
*/
|
||||
@@ -9,7 +9,6 @@ import type { Router } from 'vue-router';
|
||||
import { config } from '@/config';
|
||||
import { adminModulePath } from '@/features/admin/constants/modules';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import { CONTRACT_PAYMENT_ACCESS_PERMISSION } from '@/features/contract-payment/constants';
|
||||
import { isPublicPath } from '@/shared/constants/routes';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { resolveSafeRedirect } from '@/shared/utils/redirect';
|
||||
@@ -98,9 +97,7 @@ export function setupRouterGuards(router: Router): void {
|
||||
.find((key): key is string => Boolean(key));
|
||||
if (requiredFeature && !auth.hasFeaturePermission(requiredFeature)) {
|
||||
// 无专项权限时提示后再回应用管理,避免静默跳转让用户以为菜单坏了。
|
||||
const messageKey = requiredFeature === CONTRACT_PAYMENT_ACCESS_PERMISSION
|
||||
? 'errors.codes.CONTRACT_PAYMENT_FORBIDDEN'
|
||||
: 'errors.codes.AUTH_FORBIDDEN';
|
||||
const messageKey = 'errors.codes.AUTH_FORBIDDEN';
|
||||
useMessage().warning(String(i18n.global.t(messageKey)));
|
||||
next('/workspace/applications');
|
||||
return;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/**
|
||||
* app/router/routes/workspace.routes.ts
|
||||
* 工作台路由表:/workspace 布局壳 + 各业务子页面懒加载。
|
||||
* 依赖:vue-router、contract-payment 权限常量;meta.title 存 i18n key(workspace.*),由 guards 解析为 document.title。
|
||||
* 逻辑:WorkspaceLayout 嵌套应用首页、知识库、排程、反馈等子页;合同付款子路由用 requiresFeaturePermission 而非 requiresAdmin;立账凭证明细为 accounting-voucher-check/runs/:runId。
|
||||
* 依赖:vue-router;meta.title 存 i18n key(workspace.*),由 guards 解析为 document.title。
|
||||
* 逻辑:WorkspaceLayout 嵌套应用首页、知识库、排程、反馈等子页;合同付款旧地址重定向到 Chat Agent。
|
||||
* 立账凭证明细为 accounting-voucher-check/runs/:runId。
|
||||
*/
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
import { CONTRACT_PAYMENT_ACCESS_PERMISSION } from '@/features/contract-payment/constants';
|
||||
|
||||
const contractPaymentChatRedirect = () => import('@/features/contract-payment/views/ContractPaymentChatRedirect.vue');
|
||||
|
||||
export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
@@ -93,26 +95,26 @@ export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: 'contract-payment',
|
||||
name: 'workspace-contract-payment',
|
||||
component: () => import('@/features/contract-payment/views/ContractPaymentPage.vue'),
|
||||
meta: { title: 'workspace.nav.contractPayment', requiresFeaturePermission: CONTRACT_PAYMENT_ACCESS_PERMISSION },
|
||||
component: contractPaymentChatRedirect,
|
||||
meta: { title: 'workspace.nav.contractPayment' },
|
||||
},
|
||||
{
|
||||
path: 'contract-payment/review',
|
||||
name: 'workspace-contract-payment-review',
|
||||
component: () => import('@/features/contract-payment/views/ContractPaymentReviewPage.vue'),
|
||||
meta: { title: 'workspace.nav.contractPaymentReview', requiresFeaturePermission: CONTRACT_PAYMENT_ACCESS_PERMISSION },
|
||||
component: contractPaymentChatRedirect,
|
||||
meta: { title: 'workspace.nav.contractPaymentReview' },
|
||||
},
|
||||
{
|
||||
path: 'contract-payment/weekly-batches',
|
||||
name: 'workspace-contract-payment-weekly-batches',
|
||||
component: () => import('@/features/contract-payment/views/ContractPaymentWeeklyBatchesPage.vue'),
|
||||
meta: { title: 'workspace.nav.contractPaymentWeeklyBatches', requiresFeaturePermission: CONTRACT_PAYMENT_ACCESS_PERMISSION },
|
||||
component: contractPaymentChatRedirect,
|
||||
meta: { title: 'workspace.nav.contractPaymentWeeklyBatches' },
|
||||
},
|
||||
{
|
||||
path: 'contract-payment/contracts/:contractId',
|
||||
name: 'workspace-contract-payment-detail',
|
||||
component: () => import('@/features/contract-payment/views/ContractPaymentDetailPage.vue'),
|
||||
meta: { title: 'workspace.nav.contractPayment', requiresFeaturePermission: CONTRACT_PAYMENT_ACCESS_PERMISSION },
|
||||
component: contractPaymentChatRedirect,
|
||||
meta: { title: 'workspace.nav.contractPayment' },
|
||||
},
|
||||
{
|
||||
path: 'feedback',
|
||||
|
||||
@@ -217,19 +217,13 @@ onMounted(() => {
|
||||
>
|
||||
{{ t('admin.role.' + user.role) }}
|
||||
</span>
|
||||
<div v-if="user.feature_permissions?.training_hr_manage || user.feature_permissions?.['contract_payment.access']" class="mt-2 flex flex-wrap gap-1.5">
|
||||
<div v-if="user.feature_permissions?.training_hr_manage" class="mt-2 flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-if="user.feature_permissions?.training_hr_manage"
|
||||
class="inline-flex rounded-full border border-brand-100 bg-brand-50 px-2.5 py-0.5 text-xs font-medium text-brand-700"
|
||||
>
|
||||
{{ t('admin.user.fields.trainingHrManage') }}
|
||||
</span>
|
||||
<span
|
||||
v-if="user.feature_permissions?.['contract_payment.access']"
|
||||
class="inline-flex rounded-full border border-brand-100 bg-brand-50 px-2.5 py-0.5 text-xs font-medium text-brand-700"
|
||||
>
|
||||
{{ t('admin.user.fields.contractPaymentAccess') }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/admin/modules/users/components/UserFormModal.vue
|
||||
* 创建/编辑用户弹窗,含角色与功能权限勾选(培训 HR、合同付款预警访问)。
|
||||
* 创建/编辑用户弹窗,含角色与培训 HR 功能权限勾选。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -105,17 +105,6 @@ const { t } = useI18n();
|
||||
<span class="block text-xs leading-5 text-muted">{{ t('admin.user.fields.trainingHrManageHint') }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<label class="flex items-start gap-3 rounded-xl border border-default bg-white px-4 py-3">
|
||||
<input
|
||||
v-model="form.feature_permissions['contract_payment.access']"
|
||||
type="checkbox"
|
||||
class="mt-0.5 h-4 w-4 rounded border-default text-brand-600 focus:ring-brand-500"
|
||||
/>
|
||||
<span class="space-y-1">
|
||||
<span class="block text-sm font-medium text-primary">{{ t('admin.user.fields.contractPaymentAccess') }}</span>
|
||||
<span class="block text-xs leading-5 text-muted">{{ t('admin.user.fields.contractPaymentAccessHint') }}</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-semibold text-muted uppercase tracking-wider">
|
||||
|
||||
@@ -205,7 +205,6 @@ export function useUsersAdmin() {
|
||||
phone_number: user.phone_number || '',
|
||||
feature_permissions: {
|
||||
training_hr_manage: Boolean(user.feature_permissions?.training_hr_manage),
|
||||
'contract_payment.access': Boolean(user.feature_permissions?.['contract_payment.access']),
|
||||
},
|
||||
agent_ids: user.agent_ids || [],
|
||||
};
|
||||
|
||||
@@ -15,7 +15,6 @@ export interface UserFormState {
|
||||
phone_number: string;
|
||||
feature_permissions: {
|
||||
training_hr_manage: boolean;
|
||||
'contract_payment.access': boolean;
|
||||
};
|
||||
agent_ids: number[];
|
||||
}
|
||||
@@ -54,7 +53,6 @@ export const createEmptyUserForm = (): UserFormState => ({
|
||||
phone_number: '',
|
||||
feature_permissions: {
|
||||
training_hr_manage: false,
|
||||
'contract_payment.access': false,
|
||||
},
|
||||
agent_ids: [],
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* features/auth/stores/auth.store.ts
|
||||
* 认证全局状态;Phase 0 仍委托 utils/auth 读写 storage。
|
||||
* 依赖:shared/utils/auth、contract-payment 权限常量。
|
||||
* 依赖:shared/utils/auth。
|
||||
* 逻辑:登录态同步到 Pinia;hasFeaturePermission 供路由守卫与侧栏判断专项权限。
|
||||
*/
|
||||
import { defineStore } from 'pinia';
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
type AuthUser,
|
||||
type FeaturePermissions,
|
||||
} from '@/shared/utils/auth';
|
||||
import { CONTRACT_PAYMENT_ACCESS_PERMISSION } from '@/features/contract-payment/constants';
|
||||
|
||||
export type { AuthUser, FeaturePermissions };
|
||||
|
||||
@@ -36,18 +35,15 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
/**
|
||||
* 判断当前登录用户是否具备指定功能权限。
|
||||
* 核心逻辑:读取登录态 feature_permissions 的显式布尔值;键缺失时,合同付款访问与后端角色默认对齐(admin 为 true),避免权限键新增前写入的旧会话被误拦。
|
||||
* 核心逻辑:读取登录态 feature_permissions 的显式布尔值;键缺失时回退 false。
|
||||
* @param permissionKey - 后端 User.get_feature_permissions 下发的键
|
||||
* @returns 显式为 true,或键缺失且命中角色默认时返回 true
|
||||
* @returns 显式为 true 时返回 true
|
||||
*/
|
||||
const hasFeaturePermission = (permissionKey: string): boolean => {
|
||||
const bag = user.value?.feature_permissions;
|
||||
if (bag && Object.prototype.hasOwnProperty.call(bag, permissionKey)) {
|
||||
return Boolean(bag[permissionKey]);
|
||||
}
|
||||
if (permissionKey === CONTRACT_PAYMENT_ACCESS_PERMISSION) {
|
||||
return user.value?.role === 'admin';
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
@@ -311,6 +311,25 @@ export async function getLeanTrainingDashboard(taskId?: number): Promise<LeanTra
|
||||
};
|
||||
}
|
||||
|
||||
export async function exportLeanTrainingDashboard(taskId: number): Promise<void> {
|
||||
const response = await fetch(`/api/admin/lean-training/dashboard/export?task_id=${taskId}`, {
|
||||
method: 'GET',
|
||||
headers: getAuthHeaders(),
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Export failed: HTTP ${response.status}`);
|
||||
}
|
||||
const blob = await response.blob();
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = `lean_training_dashboard_${new Date().toISOString().slice(0, 10)}.xlsx`;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
/** HR 对指定成员发起精益培训定向提醒;返回后端实发统计(sent/failed 才是真实送达情况,created 含发送失败)。 */
|
||||
export async function sendLeanTrainingReminders(weeklyTaskId: number, userIds: number[]): Promise<{ created: number; sent: number; skipped: number; failed: number }> {
|
||||
return requestJson<{ created: number; sent: number; skipped: number; failed: number }>(`/api/admin/lean-training/weekly-tasks/${weeklyTaskId}/reminders`, {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/chat/components/ChatMobileHeader.vue
|
||||
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。
|
||||
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。合同付款预警可隐藏历史入口。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
@@ -15,6 +15,7 @@ defineProps<{
|
||||
activeAgentId: number;
|
||||
hasAgentGuides: boolean;
|
||||
userAgents: ChatMobileHeaderAgent[];
|
||||
hideHistory?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -85,6 +86,7 @@ onBeforeUnmount(() => {
|
||||
<LayoutGrid class="h-5 w-5" />
|
||||
</button>
|
||||
<button
|
||||
v-if="!hideHistory"
|
||||
type="button"
|
||||
class="flex h-9 w-9 items-center justify-center rounded-full text-muted transition-colors hover-surface-soft"
|
||||
:title="$t('chat.history')"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* 依赖:lucide-vue-next、LocaleToggleButton、ExternalSystemLinks、AgentCategoryList、chat.types。
|
||||
* 逻辑:由聊天页面传入当前 Agent、历史记录与用户可用 Agent;通过事件把新会话、切换 Agent、反馈、进入管理控制台等操作回传给页面。
|
||||
* 管理员通过底部右侧工具图标进入管理控制台;用户下拉菜单仅保留退出登录。
|
||||
* 关联服务入口与主题/语言等底栏图标统一为同尺寸 inline icon 按钮,避免错位。
|
||||
* 合同付款预警第一期不走对话,hideSessionUi 时隐藏新会话与历史列表。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
@@ -48,6 +48,7 @@ const props = defineProps<{
|
||||
userAgents: ChatSidebarAgent[];
|
||||
currentUser: Record<string, unknown> | null;
|
||||
appliedTheme: string;
|
||||
hideSessionUi?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -198,13 +199,16 @@ const orderExtractionAttentionClass = (item: DisplayHistoryItem) => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="px-4 pb-4">
|
||||
<div v-if="!hideSessionUi" class="px-4 pb-4">
|
||||
<button type="button" class="chat-sidebar-btn" @click="onNewChat">
|
||||
<Plus class="h-4 w-4" /> {{ $t('chat.createNewChat') }}
|
||||
</button>
|
||||
</div>
|
||||
<p v-else class="px-4 pb-3 text-xs leading-5 text-muted">
|
||||
{{ $t('admin.contractPayment.sessionHint') }}
|
||||
</p>
|
||||
|
||||
<div class="flex items-center justify-between px-4 py-2">
|
||||
<div v-if="!hideSessionUi" class="flex items-center justify-between px-4 py-2">
|
||||
<span class="text-xs font-semibold text-muted">{{ $t('chat.history') }}</span>
|
||||
<button
|
||||
v-if="displayHistory.length > 0"
|
||||
@@ -216,7 +220,7 @@ const orderExtractionAttentionClass = (item: DisplayHistoryItem) => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="scrollbar-thin flex-1 overflow-y-auto px-2">
|
||||
<div v-if="!hideSessionUi" class="scrollbar-thin flex-1 overflow-y-auto px-2">
|
||||
<div v-if="displayHistory.length === 0" class="py-8 text-center text-sm italic text-muted">
|
||||
{{ $t('chat.noHistory') }}
|
||||
</div>
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
* 用途:对话页主区域,组合侧栏、消息列表、输入栏、货代会话 Workflow 时间线与内置浏览器。
|
||||
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、chat.context。
|
||||
* 依赖:ChatSidebar、ChatMessageList、ChatInputBar、ShippingWorkflowTimeline、ContractPaymentChatPanel、chat.context。
|
||||
|
||||
* 逻辑:本文件只做页面结构编排;货代 Chat 仅上传/进度通知,履约写操作不在本页;
|
||||
* 右侧「本次处理」由 conversationId 驱动 Workflow projection,extractionRunNo 仅作进度装饰;
|
||||
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js。
|
||||
* 订单复核工作台异步分包,避免普通对话首屏拉取 PDF.js;合同付款预警 Agent 用 Tab 台账替换消息列表与输入框。
|
||||
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,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 } from '@/shared/utils/agent-registry.utils';
|
||||
import { agentHasIntentUiProfile, resolveAgentCode, AGENT_CODE_IN_TRANSIT_TRANSFER, isContractPaymentAgent } from '@/shared/utils/agent-registry.utils';
|
||||
|
||||
import {
|
||||
SHIPPING_WORKFLOW_KEY,
|
||||
@@ -70,6 +70,10 @@ const ShippingOrderReviewView = defineAsyncComponent(
|
||||
() => import('@/features/chat/views/ShippingOrderReviewView.vue'),
|
||||
);
|
||||
|
||||
const ContractPaymentChatPanel = defineAsyncComponent(
|
||||
() => import('@/features/contract-payment/components/ContractPaymentChatPanel.vue'),
|
||||
);
|
||||
|
||||
type MaintenanceRecordPanelCommand = {
|
||||
|
||||
mode: 'list' | 'create';
|
||||
@@ -114,6 +118,9 @@ const isMaintenanceAgentPage = computed(() => agentHasIntentUiProfile(page.curre
|
||||
/** 在途仓自动调拨 Agent:无消息时展示专属首页入口区(决策:补 Chat 首页入口 A 方案)。 */
|
||||
const isInTransitTransferAgent = computed(() => resolveAgentCode(page.currentAgent) === AGENT_CODE_IN_TRANSIT_TRANSFER);
|
||||
|
||||
/** 合同付款预警 Agent:主区嵌台账 Tab,隐藏对话输入与历史。 */
|
||||
const isContractPaymentAgentPage = computed(() => isContractPaymentAgent(page.currentAgent));
|
||||
|
||||
/** 在途仓自动调拨业务流激活(来源选择/待处理等子视图)时隐藏聊天输入框,模拟业务页。 */
|
||||
const transferFlowActive = ref(false);
|
||||
watch(isInTransitTransferAgent, (isTransfer) => { if (!isTransfer) transferFlowActive.value = false; });
|
||||
@@ -391,6 +398,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
:applied-theme="page.appliedTheme"
|
||||
|
||||
:hide-session-ui="isContractPaymentAgentPage"
|
||||
|
||||
@new-chat="page.handleSidebarNewChat"
|
||||
|
||||
@open-guide="page.openGuideModal"
|
||||
@@ -431,6 +440,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
:user-agents="page.userAgents"
|
||||
|
||||
:hide-history="isContractPaymentAgentPage"
|
||||
|
||||
@open-guide="page.openGuideModal"
|
||||
|
||||
@go-history="page.goToWorkspace('history')"
|
||||
@@ -473,6 +484,8 @@ watch(() => page.currentAgentId, () => {
|
||||
|
||||
<ShippingOrderReviewView v-if="isOrderReviewMode" />
|
||||
|
||||
<ContractPaymentChatPanel v-else-if="isContractPaymentAgentPage" />
|
||||
|
||||
<div v-else class="flex min-h-0 min-w-0 flex-1" :class="showShippingWorkflowTimeline ? 'shipping-workbench-layout' : ''">
|
||||
|
||||
<div class="flex min-h-0 min-w-0 flex-1 flex-col" :class="showShippingWorkflowTimeline ? 'shipping-chat-column' : ''">
|
||||
|
||||
@@ -500,6 +500,17 @@ const stopNonSafetyVideoTimer = () => {
|
||||
workspace.stopMaterialTimer();
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理普通培训主视频播放结束事件。
|
||||
* AI 触发时机:学员完整播放当前主视频到结尾时调用;仅出国规章培训将视频播放结束作为一次学习完成,其他培训类型保持现有阶段推进入口。
|
||||
*/
|
||||
const handleNonSafetyVideoEnded = () => {
|
||||
stopNonSafetyVideoTimer();
|
||||
if (workspace.isOverseasRegulationsTraining) {
|
||||
workspace.markVideoCompleted();
|
||||
}
|
||||
};
|
||||
|
||||
watch([() => workspace.learnerTab, nonSafetyVideoMaterials], () => {
|
||||
if (!nonSafetyVideoMaterials.value.some((material) => material.id === activeNonSafetyVideoId.value)) {
|
||||
activeNonSafetyVideoId.value = nonSafetyVideoMaterials.value[0]?.id ?? null;
|
||||
@@ -589,8 +600,8 @@ const leanStatusMeta: Record<LeanTrainingTaskStatus, { badgeClass: string; label
|
||||
/** 看板总结弹框上下文:员工姓名 + 完整总结文案;为 null 时弹框关闭。 */
|
||||
const summaryModal = ref<{ name: string; text: string } | null>(null);
|
||||
|
||||
/** 总结列预览截断:最多显示 15 个字,超出部分以省略号收尾,点击可弹框查看全文。 */
|
||||
const truncateSummary = (text: string) => (text.length > 15 ? `${text.slice(0, 15)}…` : text);
|
||||
/** 总结列预览截断:最多显示 4 个字,超出部分以省略号收尾,点击可弹框查看全文。 */
|
||||
const truncateSummary = (text: string) => (text.length > 4 ? `${text.slice(0, 4)}…` : text);
|
||||
|
||||
/** 打开总结详情弹框:仅当该行有总结文案时可点击(无总结的行显示 "--" 不可点)。 */
|
||||
const openSummaryModal = (name: string, text: string) => {
|
||||
@@ -992,7 +1003,7 @@ const currentSafetyStageText = computed(() => {
|
||||
:src="activeNonSafetyVideo.resource?.fileUrl"
|
||||
@play="startNonSafetyVideoTimer"
|
||||
@pause="stopNonSafetyVideoTimer"
|
||||
@ended="stopNonSafetyVideoTimer"
|
||||
@ended="handleNonSafetyVideoEnded"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="mt-3 rounded-2xl border border-dashed border-default bg-surface-soft px-4 py-10 text-center text-sm text-muted">
|
||||
@@ -1831,6 +1842,10 @@ const currentSafetyStageText = computed(() => {
|
||||
>
|
||||
<option v-for="period in workspace.leanDashboard.periods" :key="period.id" :value="period.id">{{ $t('chat.training.lean.dashboard.periodLabel', { index: period.index }) }}({{ period.weekKey }})</option>
|
||||
</select>
|
||||
<button type="button" class="inline-flex items-center gap-1.5 rounded-lg bg-emerald-600 px-2.5 py-1.5 text-xs font-medium text-white transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60" :disabled="workspace.leanExportLoading" @click="workspace.exportLeanDashboard">
|
||||
<Download class="h-3.5 w-3.5" />
|
||||
{{ workspace.leanExportLoading ? $t('chat.training.lean.dashboard.exporting') : $t('chat.training.lean.dashboard.export') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-full bg-white px-3 py-1 text-xs font-medium text-emerald-700">{{ $t('chat.training.lean.dueAt', { time: workspace.leanDashboard.task.dueAt.slice(0, 16).replace('T', ' ') }) }}</div>
|
||||
@@ -1862,7 +1877,7 @@ const currentSafetyStageText = computed(() => {
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary"><div v-for="video in row.videos" :key="`${video.name}-${video.watchedAt}`" class="whitespace-nowrap">{{ video.watchedAt ? video.watchedAt.slice(0, 16).replace('T', ' ') : '--' }}</div><span v-if="!row.videos.length">--</span></td>
|
||||
<!-- 状态徽章三态:已完成(绿)/已延期(红)/进行中(蓝),文案统一中文(含其余三语言),禁止回显原始键。 -->
|
||||
<td class="border-b border-default px-3 py-2.5"><span class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold" :class="row.status === 'completed' ? 'bg-emerald-50 text-emerald-700' : row.status === 'overdue' ? 'bg-red-50 text-red-700' : 'bg-blue-50 text-blue-700'">{{ $t(`chat.training.lean.status.${row.status}`) }}</span></td>
|
||||
<!-- [RULE] 总结列最多显示 15 个字:超出截断并显示省略号,点击弹框查看全部文案;无总结显示 "--"。
|
||||
<!-- [RULE] 总结列最多显示 4 个字:超出截断并显示省略号,点击弹框查看全部文案;无总结显示 "--"。
|
||||
常显虚线下划线提示可点击(用户复测反馈点击无效,实为部署版本差异,此处强化可点性视觉)。 -->
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">
|
||||
<button v-if="row.summaryText" type="button" class="max-w-56 cursor-pointer text-left whitespace-pre-wrap break-words underline decoration-dotted decoration-secondary/60 underline-offset-2 transition hover:decoration-solid hover:text-primary" :title="$t('chat.training.lean.summaryModal.viewHint')" @click="openSummaryModal(row.name, row.summaryText)">{{ truncateSummary(row.summaryText) }}</button>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import {
|
||||
exportTrainingRecords,
|
||||
exportLeanTrainingDashboard,
|
||||
getMyTrainingConfig,
|
||||
getMyTrainingProgress,
|
||||
getMyTrainingTypes,
|
||||
@@ -82,6 +83,11 @@ export interface UseTrainingWorkspaceOptions {
|
||||
|
||||
const DEFAULT_PASS_SCORE = 90;
|
||||
const DEFAULT_TRAINING_VERSION = 'v1.0';
|
||||
const OVERSEAS_REGULATIONS_TRAINING_TYPES = new Set([
|
||||
'overseas_regulations',
|
||||
'overseas_regulations_training',
|
||||
'overseas_training',
|
||||
]);
|
||||
|
||||
const formatDate = (value: Date) => value.toISOString().slice(0, 10);
|
||||
|
||||
@@ -125,6 +131,7 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
/** 管理端精益看板当前选中的期次任务 ID;为空表示最新一期,切换后重新拉取对应期看板。 */
|
||||
const leanDashboardTaskId = ref<number | null>(null);
|
||||
const leanReminderLoading = ref<Record<number, boolean>>({});
|
||||
const leanExportLoading = ref(false);
|
||||
/** 按任务 ID 分组的感悟草稿,支持时间树上多期任务并行编辑。 */
|
||||
const leanSummaryByTask = ref<Record<number, string>>({});
|
||||
/** 按任务 ID 分组的观看记录(资源 ID -> 观看时间),提交时随感悟一并交由服务端校验。 */
|
||||
@@ -136,6 +143,10 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
{ code: 'onboarding', name: t('chat.training.safety.tabs.onboarding') },
|
||||
{ code: 'safety', name: t('chat.training.safety.tabs.safety') },
|
||||
]);
|
||||
const isOverseasRegulationsTraining = computed(() => (
|
||||
OVERSEAS_REGULATIONS_TRAINING_TYPES.has(learnerTab.value)
|
||||
|| trainingTypes.value.some((item) => item.code === learnerTab.value && item.name.includes('出国规章'))
|
||||
));
|
||||
const trainingVersion = ref<string>(DEFAULT_TRAINING_VERSION);
|
||||
const examMode = ref<TrainingExamMode>('unified');
|
||||
const safetyStage = ref<SafetyStage>('company');
|
||||
@@ -147,6 +158,11 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
});
|
||||
|
||||
const stage = ref<TrainingStage>('video');
|
||||
watch(isOverseasRegulationsTraining, (isOverseas) => {
|
||||
if (isOverseas) {
|
||||
stage.value = 'video';
|
||||
}
|
||||
});
|
||||
const currentQuestionIndex = ref(0);
|
||||
const score = ref(0);
|
||||
const attemptCount = ref(0);
|
||||
@@ -665,7 +681,7 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
safetyViewStage.value = record.safetyStage || 'company';
|
||||
}
|
||||
}
|
||||
stage.value = record.stage;
|
||||
stage.value = isOverseasRegulationsTraining.value ? 'video' : record.stage;
|
||||
syncExamQuestionIndex(record.currentQuestionIndex);
|
||||
score.value = Number(record.score || 0);
|
||||
attemptCount.value = Number(record.attempts || 0);
|
||||
@@ -706,7 +722,7 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
safetyProgress: learnerTab.value === 'safety' ? safetyProgress.value : null,
|
||||
currentQuestionIndex: currentQuestionIndex.value,
|
||||
score: score.value,
|
||||
passed: isPassed.value,
|
||||
passed: isOverseasRegulationsTraining.value && stage.value === 'result' ? true : isPassed.value,
|
||||
attemptCount: attemptCount.value,
|
||||
answerDetails: answerRecords.value,
|
||||
joinDate: currentJoinDate.value || formatDate(new Date()),
|
||||
@@ -749,11 +765,14 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
isHydrated.value = true;
|
||||
return;
|
||||
}
|
||||
const requestedTrainingType = learnerTab.value;
|
||||
try {
|
||||
const record = await getMyTrainingProgress(learnerTab.value);
|
||||
const record = await getMyTrainingProgress(requestedTrainingType);
|
||||
if (learnerTab.value !== requestedTrainingType) return;
|
||||
hasWarnedLoadFailure.value = false;
|
||||
applyProgressRecord(record);
|
||||
} catch (error) {
|
||||
if (learnerTab.value !== requestedTrainingType) return;
|
||||
// 退出登录或登录态失效时,培训页可能尚未卸载;这里静默清空状态,避免把正常 401 提示成“读取失败”。
|
||||
if (error instanceof BusinessError && error.status === 401) {
|
||||
hasWarnedLoadFailure.value = false;
|
||||
@@ -782,15 +801,21 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
trainingConfigLoading.value = false;
|
||||
return;
|
||||
}
|
||||
const requestedTrainingType = learnerTab.value;
|
||||
trainingConfigLoading.value = true;
|
||||
try {
|
||||
publishedConfig.value = await getMyTrainingConfig(learnerTab.value);
|
||||
const config = await getMyTrainingConfig(requestedTrainingType);
|
||||
if (learnerTab.value === requestedTrainingType) {
|
||||
publishedConfig.value = config;
|
||||
}
|
||||
} catch (error) {
|
||||
if (!(error instanceof BusinessError && error.status === 401)) {
|
||||
if (learnerTab.value === requestedTrainingType && !(error instanceof BusinessError && error.status === 401)) {
|
||||
publishedConfig.value = null;
|
||||
}
|
||||
} finally {
|
||||
trainingConfigLoading.value = false;
|
||||
if (learnerTab.value === requestedTrainingType) {
|
||||
trainingConfigLoading.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -841,6 +866,20 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
await loadLeanDashboard();
|
||||
};
|
||||
|
||||
const exportLeanDashboard = async () => {
|
||||
const taskId = leanDashboardTaskId.value ?? leanDashboard.value.task?.id;
|
||||
if (!taskId || leanExportLoading.value) return;
|
||||
leanExportLoading.value = true;
|
||||
try {
|
||||
await exportLeanTrainingDashboard(taskId);
|
||||
msg.success(t('chat.training.lean.dashboard.exportSuccess'));
|
||||
} catch {
|
||||
msg.error(t('chat.training.lean.dashboard.exportFailed'));
|
||||
} finally {
|
||||
leanExportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 读取学员端全部已发布精益周任务(含状态与播放地址),并以服务端完成记录回填各任务的感悟/观看草稿。 */
|
||||
const loadLeanTraining = async () => {
|
||||
if (!isTrainingAgent.value || !hasAuthenticatedUser.value) return;
|
||||
@@ -966,11 +1005,25 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
);
|
||||
|
||||
const markVideoCompleted = () => {
|
||||
if (!hasPublishedTrainingConfig.value || !videoUrl.value) return;
|
||||
if (!hasPublishedTrainingConfig.value) return;
|
||||
if (!isOverseasRegulationsTraining.value && !videoUrl.value) return;
|
||||
if (learnerTab.value === 'safety') {
|
||||
checkAndAdvanceStage();
|
||||
return;
|
||||
}
|
||||
if (isOverseasRegulationsTraining.value) {
|
||||
stage.value = 'result';
|
||||
score.value = 100;
|
||||
completionDate.value = formatDate(new Date());
|
||||
latestSettledResult.value = {
|
||||
score: 100,
|
||||
correctCount: 0,
|
||||
wrongCount: 0,
|
||||
isPassed: true,
|
||||
};
|
||||
void persistProgress();
|
||||
return;
|
||||
}
|
||||
stage.value = 'summary';
|
||||
void persistProgress();
|
||||
};
|
||||
@@ -1252,6 +1305,7 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
}
|
||||
void persistProgress();
|
||||
} else {
|
||||
if (isOverseasRegulationsTraining.value) return;
|
||||
const activeStageMaterials = publishedTrainingMaterials.value;
|
||||
if (!activeStageMaterials.length) return;
|
||||
const allCompleted = activeStageMaterials.every(m => {
|
||||
@@ -1357,6 +1411,8 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
leanStats,
|
||||
leanRows,
|
||||
leanDashboardTaskId,
|
||||
leanExportLoading,
|
||||
exportLeanDashboard,
|
||||
selectLeanDashboardPeriod,
|
||||
learnerChatPrompt,
|
||||
newSessionReminderMessage,
|
||||
@@ -1364,6 +1420,7 @@ export function useTrainingWorkspace(options: UseTrainingWorkspaceOptions) {
|
||||
learnerAssistantMessage,
|
||||
managementChatPrompt,
|
||||
markVideoCompleted,
|
||||
isOverseasRegulationsTraining,
|
||||
startExam,
|
||||
selectAnswer,
|
||||
submitTextAnswer,
|
||||
|
||||
@@ -21,11 +21,11 @@ export interface ContractPaymentContract {
|
||||
status: string; parse_status: string; plan_status: string; parse_issues?: string[]; nodes: PaymentNode[]; alerts?: PaymentAlert[]; attachments?: ContractAttachment[];
|
||||
}
|
||||
export interface ContractListResponse { total: number; page: number; page_size: number; pages: number; items: ContractPaymentContract[]; }
|
||||
export type LedgerFocus = 'due' | 'overdue' | 'needs_completion' | 'due_this_month';
|
||||
export type LedgerFocus = 'due' | 'overdue' | 'active' | 'due_this_month';
|
||||
export interface LedgerSummary {
|
||||
due: number;
|
||||
overdue: number;
|
||||
needs_completion: number;
|
||||
active: number;
|
||||
due_this_month: number;
|
||||
}
|
||||
export interface AlertBatch { id: number; batch_no: string; week_key: string; status: string; summary?: { total?: number; stages?: Record<string, number> }; excel_file_name?: string | null; excel_file_size?: number | null; sent_at?: string | null; }
|
||||
@@ -37,7 +37,7 @@ export interface AlertSummary { pending_count: number; next_send_at?: string | n
|
||||
* @param params.keyword - 模糊检索词,可为空。
|
||||
* @param params.parse_status - 解析状态精确筛选。
|
||||
* @param params.reviewOnly - 为 true 时只查 needs_review。
|
||||
* @param params.focus - 汇总卡口径:即将到期 / 逾期未付 / 待补充 / 本月应付。
|
||||
* @param params.focus - 汇总卡口径:即将到期 / 逾期未付 / 进行中 / 本月应付。
|
||||
* @returns 分页后的合同列表。
|
||||
*/
|
||||
export const listContractPaymentContracts = (params?: { keyword?: string; parse_status?: string; reviewOnly?: boolean; focus?: LedgerFocus; page?: number; pageSize?: number }) => {
|
||||
@@ -61,7 +61,7 @@ export const getContractPaymentAlertSummary = () => requestJson<AlertSummary>('/
|
||||
/**
|
||||
* 查询合同台账四张汇总卡的合同份数。
|
||||
* 核心逻辑:始终统计全部已解析台账,不跟当前 keyword;与点卡片过滤共用 focus 口径。
|
||||
* @returns due / overdue / needs_completion / due_this_month。
|
||||
* @returns due / overdue / active / due_this_month。
|
||||
*/
|
||||
export const getContractPaymentLedgerSummary = () => requestJson<LedgerSummary>('/api/contract-payment/contracts/summary');
|
||||
export const listContractPaymentAlertBatches = () => requestJson<{ items: AlertBatch[] }>('/api/contract-payment/alert-batches');
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
<!--
|
||||
features/contract-payment/components/ContractPaymentChatPanel.vue
|
||||
用途:合同付款预警 Chat 主区:管理员按钮、三 Tab、当前 Tab 内详情下钻。
|
||||
依赖:contract-payment 三页与详情、useContractPaymentAdminActions、vue-router query。
|
||||
逻辑:由 ChatViewContent 在 agent_code=contract_payment 时替换消息列表与输入框;
|
||||
view / contractId 写入 /chat/:agentId 查询参数,旧工作台地址重定向后仍可深链打开。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { CalendarClock, RefreshCw, Send } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { listContractPaymentContracts } from '../api/contract-payment.api';
|
||||
import { useContractPaymentAdminActions } from '../composables/useContractPaymentAdminActions';
|
||||
import type { ContractPaymentView } from '../constants';
|
||||
import {
|
||||
buildContractPaymentChatQuery,
|
||||
parseContractPaymentChatQuery,
|
||||
} from '../utils/contractPaymentChat.utils';
|
||||
import ContractPaymentPage from '../views/ContractPaymentPage.vue';
|
||||
import ContractPaymentReviewPage from '../views/ContractPaymentReviewPage.vue';
|
||||
import ContractPaymentWeeklyBatchesPage from '../views/ContractPaymentWeeklyBatchesPage.vue';
|
||||
import ContractPaymentDetailPage from '../views/ContractPaymentDetailPage.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const parsedQuery = computed(() => parseContractPaymentChatQuery(route.query.view, route.query.contractId));
|
||||
const activeView = computed<ContractPaymentView>(() => parsedQuery.value.view);
|
||||
const detailId = computed(() => parsedQuery.value.contractId);
|
||||
const reviewCount = ref(0);
|
||||
|
||||
const {
|
||||
isAdmin,
|
||||
actionLoading,
|
||||
showForceSyncConfirm,
|
||||
showReparseExistingConfirm,
|
||||
run,
|
||||
confirmForceSync,
|
||||
confirmReparseExisting,
|
||||
} = useContractPaymentAdminActions();
|
||||
|
||||
const tabs = computed(() => ([
|
||||
{ key: 'ledger' as const, label: t('admin.contractPayment.ledger') },
|
||||
{ key: 'review' as const, label: t('admin.contractPaymentReview.title'), count: reviewCount.value },
|
||||
{ key: 'batches' as const, label: t('admin.contractPayment.weeklyBatchesTitle') },
|
||||
]));
|
||||
|
||||
/**
|
||||
* 把当前 Tab / 详情写入 Chat 路由,保持刷新与旧地址重定向可用。
|
||||
* 核心逻辑:replace 避免 Tab 切换堆积历史;切 Tab 时清掉 contractId。
|
||||
*/
|
||||
async function syncQuery(view: ContractPaymentView, contractId: number | null): Promise<void> {
|
||||
const nextQuery = buildContractPaymentChatQuery(view, contractId);
|
||||
const currentView = String(route.query.view || '');
|
||||
const currentContractId = String(route.query.contractId || '');
|
||||
if (currentView === nextQuery.view && currentContractId === (nextQuery.contractId || '')) return;
|
||||
const query = { ...route.query, ...nextQuery };
|
||||
if (!contractId) delete query.contractId;
|
||||
await router.replace({ params: { ...route.params }, query });
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换主 Tab;详情下钻随 Tab 关闭,避免第四个隐形页。
|
||||
*/
|
||||
function selectView(view: ContractPaymentView): void {
|
||||
void syncQuery(view, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在当前 Tab 内打开合同详情。
|
||||
*/
|
||||
function openDetail(contractId: number): void {
|
||||
void syncQuery(activeView.value, contractId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从详情返回当前 Tab 列表。
|
||||
*/
|
||||
function closeDetail(): void {
|
||||
void syncQuery(activeView.value, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取待确认合同数量,供 Tab 角标展示。
|
||||
* 核心逻辑:只取 total,不拉列表正文,失败时角标归零不打断主区。
|
||||
*/
|
||||
async function loadReviewCount(): Promise<void> {
|
||||
try {
|
||||
const result = await listContractPaymentContracts({
|
||||
reviewOnly: true,
|
||||
page: 1,
|
||||
pageSize: 1,
|
||||
});
|
||||
reviewCount.value = result.total || 0;
|
||||
} catch {
|
||||
reviewCount.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadReviewCount();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.query.view,
|
||||
(rawView) => {
|
||||
if (rawView) return;
|
||||
void syncQuery(activeView.value, detailId.value);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[var(--surface-muted,#f4f7fb)]">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3 px-5 pt-5">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-xl font-bold text-primary">{{ t('admin.contractPayment.title') }}</h1>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPayment.subtitle') }}</p>
|
||||
</div>
|
||||
<div v-if="isAdmin" class="flex flex-wrap gap-2">
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('sync')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.sync') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('force-sync')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.forceSync') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('reparse-existing')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.reparseExisting') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('scan')">
|
||||
<CalendarClock class="h-4 w-4" />{{ t('admin.contractPayment.scanAlerts') }}
|
||||
</button>
|
||||
<button class="btn-primary" type="button" :disabled="actionLoading" @click="run('weekly')">
|
||||
<Send class="h-4 w-4" />{{ t('admin.contractPayment.weeklySend') }}
|
||||
</button>
|
||||
</div>
|
||||
</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 }}
|
||||
<span
|
||||
v-if="tab.key === 'review' && tab.count"
|
||||
class="ml-1 inline-grid h-[18px] min-w-[18px] place-items-center rounded-full bg-amber-50 px-1.5 text-[11px] text-amber-700"
|
||||
>{{ tab.count }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="min-h-0 flex-1 overflow-auto px-5 py-4">
|
||||
<ContractPaymentDetailPage
|
||||
v-if="detailId"
|
||||
:contract-id="detailId"
|
||||
embedded
|
||||
@close="closeDetail"
|
||||
/>
|
||||
<ContractPaymentPage
|
||||
v-else-if="activeView === 'ledger'"
|
||||
embedded
|
||||
@open-detail="openDetail"
|
||||
/>
|
||||
<ContractPaymentReviewPage
|
||||
v-else-if="activeView === 'review'"
|
||||
embedded
|
||||
@open-detail="openDetail"
|
||||
/>
|
||||
<ContractPaymentWeeklyBatchesPage
|
||||
v-else
|
||||
embedded
|
||||
/>
|
||||
</div>
|
||||
|
||||
<DeleteConfirmDialog
|
||||
v-if="isAdmin"
|
||||
v-model="showForceSyncConfirm"
|
||||
:title="t('admin.contractPayment.forceSync')"
|
||||
:message="t('admin.contractPayment.forceSyncConfirm')"
|
||||
confirm-tone="primary"
|
||||
@confirm="confirmForceSync"
|
||||
/>
|
||||
<DeleteConfirmDialog
|
||||
v-if="isAdmin"
|
||||
v-model="showReparseExistingConfirm"
|
||||
:title="t('admin.contractPayment.reparseExisting')"
|
||||
:message="t('admin.contractPayment.reparseExistingConfirm')"
|
||||
confirm-tone="primary"
|
||||
@confirm="confirmReparseExisting"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* features/contract-payment/composables/useContractPaymentAdminActions.ts
|
||||
* 用途:合同付款预警管理员异步任务(同步 / 重解析 / 扫描 / 发送)共用入口。
|
||||
* 依赖:contract-payment.api、useAuthStore、useMessage、i18n。
|
||||
* 逻辑:Chat 顶栏与旧台账页共用;非管理员直接忽略,强制覆盖和存量重解析先走确认框。
|
||||
*/
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import {
|
||||
enqueueContractPaymentAlertScan,
|
||||
enqueueContractPaymentReparse,
|
||||
enqueueContractPaymentSync,
|
||||
enqueueContractPaymentWeeklyAlert,
|
||||
} from '../api/contract-payment.api';
|
||||
|
||||
export type ContractPaymentAdminAction = 'sync' | 'force-sync' | 'reparse-existing' | 'scan' | 'weekly';
|
||||
|
||||
/**
|
||||
* 提供合同付款预警管理员操作状态与提交函数。
|
||||
* 核心逻辑:仅 role=admin 可提交;入队成功只提示任务已提交,不阻塞等待 Worker。
|
||||
* @param onAfterScanOrWeekly - 扫描或发送后刷新本周待发送摘要的回调
|
||||
*/
|
||||
export function useContractPaymentAdminActions(onAfterScanOrWeekly?: () => Promise<void> | void) {
|
||||
const { t } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const msg = useMessage();
|
||||
const isAdmin = computed(() => auth.isAdmin);
|
||||
const actionLoading = ref(false);
|
||||
const showForceSyncConfirm = ref(false);
|
||||
const showReparseExistingConfirm = ref(false);
|
||||
|
||||
/**
|
||||
* 提交合同付款预警后台任务。
|
||||
* 核心逻辑:按操作类型调用相应异步接口;扫描和发送成功后刷新摘要。
|
||||
*/
|
||||
async function submitAction(action: ContractPaymentAdminAction): Promise<void> {
|
||||
if (!isAdmin.value) return;
|
||||
actionLoading.value = true;
|
||||
try {
|
||||
if (action === 'sync' || action === 'force-sync') {
|
||||
await enqueueContractPaymentSync(action === 'force-sync');
|
||||
} else if (action === 'reparse-existing') {
|
||||
await enqueueContractPaymentReparse();
|
||||
} else if (action === 'scan') {
|
||||
await enqueueContractPaymentAlertScan();
|
||||
} else {
|
||||
await enqueueContractPaymentWeeklyAlert();
|
||||
}
|
||||
msg.success(t('admin.contractPayment.jobSubmitted'));
|
||||
if ((action === 'scan' || action === 'weekly') && onAfterScanOrWeekly) {
|
||||
await onAfterScanOrWeekly();
|
||||
}
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPayment.actionFailed'));
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发任务入口;强制覆盖和存量重解析先弹出确认框。
|
||||
*/
|
||||
function run(action: ContractPaymentAdminAction): void {
|
||||
if (!isAdmin.value) return;
|
||||
if (action === 'force-sync') {
|
||||
showForceSyncConfirm.value = true;
|
||||
return;
|
||||
}
|
||||
if (action === 'reparse-existing') {
|
||||
showReparseExistingConfirm.value = true;
|
||||
return;
|
||||
}
|
||||
void submitAction(action);
|
||||
}
|
||||
|
||||
return {
|
||||
isAdmin,
|
||||
actionLoading,
|
||||
showForceSyncConfirm,
|
||||
showReparseExistingConfirm,
|
||||
run,
|
||||
confirmForceSync: () => void submitAction('force-sync'),
|
||||
confirmReparseExisting: () => void submitAction('reparse-existing'),
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* features/contract-payment/constants.ts
|
||||
* 用途:合同付款预警前端权限键与路由 meta 共用常量。
|
||||
* 用途:合同付款预警 Chat 视图与查询参数常量。
|
||||
* 依赖:无。
|
||||
* 逻辑:路由守卫、侧栏与用户管理勾选读取同一键,须与后端 User._role_default_feature_permissions 一致。
|
||||
* 逻辑:Chat Tab、工作台旧地址重定向与详情下钻共用同一套 view 名。
|
||||
*/
|
||||
export const CONTRACT_PAYMENT_ACCESS_PERMISSION = 'contract_payment.access' as const;
|
||||
export const CONTRACT_PAYMENT_VIEWS = ['ledger', 'review', 'batches'] as const;
|
||||
|
||||
export type ContractPaymentView = (typeof CONTRACT_PAYMENT_VIEWS)[number];
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* features/contract-payment/utils/contractPaymentChat.utils.test.ts
|
||||
* 用途:锁定合同付款预警 Chat 深链 query 的解析与回写规则。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
buildContractPaymentChatQuery,
|
||||
parseContractPaymentChatQuery,
|
||||
} from './contractPaymentChat.utils';
|
||||
|
||||
describe('parseContractPaymentChatQuery', () => {
|
||||
it('accepts ledger / review / batches and a positive contractId', () => {
|
||||
expect(parseContractPaymentChatQuery('review', '12')).toEqual({
|
||||
view: 'review',
|
||||
contractId: 12,
|
||||
});
|
||||
});
|
||||
|
||||
it('falls back to ledger for unknown view and ignores invalid contractId', () => {
|
||||
expect(parseContractPaymentChatQuery('unknown', 'abc')).toEqual({
|
||||
view: 'ledger',
|
||||
contractId: null,
|
||||
});
|
||||
expect(parseContractPaymentChatQuery(undefined, '0')).toEqual({
|
||||
view: 'ledger',
|
||||
contractId: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildContractPaymentChatQuery', () => {
|
||||
it('always writes view and omits contractId on list pages', () => {
|
||||
expect(buildContractPaymentChatQuery('batches', null)).toEqual({ view: 'batches' });
|
||||
});
|
||||
|
||||
it('keeps the current tab when drilling into a contract', () => {
|
||||
expect(buildContractPaymentChatQuery('review', 9)).toEqual({
|
||||
view: 'review',
|
||||
contractId: '9',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* features/contract-payment/utils/contractPaymentChat.utils.ts
|
||||
* 用途:解析合同付款预警 Chat 的 view / contractId 查询参数。
|
||||
* 依赖:contract-payment/constants。
|
||||
* 逻辑:旧工作台重定向与 Chat Tab 共用;非法 view 回退台账。
|
||||
*/
|
||||
import { CONTRACT_PAYMENT_VIEWS, type ContractPaymentView } from '../constants';
|
||||
|
||||
export interface ContractPaymentChatQuery {
|
||||
view: ContractPaymentView;
|
||||
contractId: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把路由 query 归一成 Chat 台账视图。
|
||||
* 核心逻辑:只接受 ledger / review / batches;contractId 必须是正整数才进入详情下钻。
|
||||
* @param rawView - 路由 query.view
|
||||
* @param rawContractId - 路由 query.contractId
|
||||
* @returns 可安全写入 Tab 与详情状态的查询对象
|
||||
*/
|
||||
export function parseContractPaymentChatQuery(
|
||||
rawView: unknown,
|
||||
rawContractId: unknown,
|
||||
): ContractPaymentChatQuery {
|
||||
const view = CONTRACT_PAYMENT_VIEWS.includes(String(rawView) as ContractPaymentView)
|
||||
? String(rawView) as ContractPaymentView
|
||||
: 'ledger';
|
||||
const parsed = Number(rawContractId);
|
||||
const contractId = Number.isInteger(parsed) && parsed > 0 ? parsed : null;
|
||||
return { view, contractId };
|
||||
}
|
||||
|
||||
/**
|
||||
* 把台账视图写回 Chat 路由 query,便于刷新与旧工作台重定向共用同一深链。
|
||||
* 核心逻辑:始终带 view;仅在下钻详情时带 contractId,避免空 query 污染地址栏。
|
||||
* @param view - 当前 Tab
|
||||
* @param contractId - 详情合同 ID;列表态传 null
|
||||
*/
|
||||
export function buildContractPaymentChatQuery(
|
||||
view: ContractPaymentView,
|
||||
contractId: number | null,
|
||||
): Record<string, string> {
|
||||
const query: Record<string, string> = { view };
|
||||
if (contractId) query.contractId = String(contractId);
|
||||
return query;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<!--
|
||||
features/contract-payment/views/ContractPaymentChatRedirect.vue
|
||||
用途:把旧工作台合同付款预警 URL 转到对应 Chat Agent 深链。
|
||||
依赖:listUserAgents、isContractPaymentAgent、contractPaymentChat.utils。
|
||||
逻辑:按路径还原 view / contractId,再在当前用户 Agent 列表中定位 contract_payment;
|
||||
未授权时提示并回应用管理。本页不渲染业务 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 { isContractPaymentAgent } from '@/shared/utils/agent-registry.utils';
|
||||
import { WORKSPACE_PATHS } from '@/features/workspace/constants/routes';
|
||||
import type { ContractPaymentView } from '../constants';
|
||||
import { buildContractPaymentChatQuery } from '../utils/contractPaymentChat.utils';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
|
||||
/**
|
||||
* 从旧工作台路径还原 Chat Tab 与详情合同。
|
||||
* 核心逻辑:review / weekly-batches / contracts/:id 分别对应三个 Tab 与台账下钻。
|
||||
*/
|
||||
function resolveLegacyTarget(): { view: ContractPaymentView; contractId: number | null } {
|
||||
const path = String(route.path || '');
|
||||
if (path.includes('/contract-payment/review')) {
|
||||
return { view: 'review', contractId: null };
|
||||
}
|
||||
if (path.includes('/contract-payment/weekly-batches')) {
|
||||
return { view: 'batches', contractId: null };
|
||||
}
|
||||
const detailMatch = path.match(/\/contract-payment\/contracts\/(\d+)/);
|
||||
if (detailMatch) {
|
||||
return { view: 'ledger', contractId: Number(detailMatch[1]) };
|
||||
}
|
||||
return { view: 'ledger', contractId: null };
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找当前用户可用的合同付款预警 Agent 并跳转 Chat。
|
||||
* 核心逻辑:admin 与已授权用户都能在 /api/agents 看到该 Agent;找不到则视为无权限。
|
||||
*/
|
||||
async function redirectToChat(): Promise<void> {
|
||||
const { view, contractId } = resolveLegacyTarget();
|
||||
try {
|
||||
const agents = await listUserAgents();
|
||||
const agent = Array.isArray(agents) ? agents.find((item) => isContractPaymentAgent(item)) : null;
|
||||
const agentId = Number(agent?.id);
|
||||
if (!Number.isInteger(agentId) || agentId <= 0) {
|
||||
msg.warning(t('errors.codes.CONTRACT_PAYMENT_FORBIDDEN'));
|
||||
await router.replace(WORKSPACE_PATHS.applications);
|
||||
return;
|
||||
}
|
||||
await router.replace({
|
||||
path: `/chat/${agentId}`,
|
||||
query: buildContractPaymentChatQuery(view, contractId),
|
||||
});
|
||||
} catch {
|
||||
msg.warning(t('errors.codes.CONTRACT_PAYMENT_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,12 +1,11 @@
|
||||
<!--
|
||||
features/contract-payment/views/ContractPaymentDetailPage.vue
|
||||
用途:展示单份采购合同的概览、原文附件、付款计划及企业微信预警审计。
|
||||
依赖:contract-payment.api、vue-router、统一消息提示;由合同付款台账的行点击进入。
|
||||
依赖:contract-payment.api、统一消息提示;由 Chat 台账/待确认行点击在当前 Tab 内下钻。
|
||||
逻辑:以合同 ID 调用已有详情接口,所有付款任务按付款节点和预警轮次聚合呈现。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { ArrowLeft, CircleHelp, Download, FileText, RefreshCw } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
@@ -20,20 +19,26 @@ import {
|
||||
type ContractPaymentContract,
|
||||
type PaymentNode,
|
||||
} from '../api/contract-payment.api';
|
||||
import { WORKSPACE_PATHS } from '@/features/workspace/constants/routes';
|
||||
import { displayCurrency } from '../utils/currency';
|
||||
import { isNodeNearDue, isNodeOverdue, nodeDueReference } from '../utils/paymentStatus';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
contractId: number;
|
||||
embedded?: boolean;
|
||||
}>(), { embedded: false });
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: [];
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const msg = useMessage();
|
||||
const contract = ref<ContractPaymentContract | null>(null);
|
||||
const loading = ref(false);
|
||||
const downloadingId = ref<number | null>(null);
|
||||
const reparsing = ref(false);
|
||||
const activeTab = ref<'plan' | 'attachments' | 'alerts'>('plan');
|
||||
const contractId = computed(() => Number(route.params.contractId));
|
||||
const contractId = computed(() => Number(props.contractId));
|
||||
const orderedNodes = computed(() => {
|
||||
const order = ['prepayment', 'shipment', 'acceptance', 'warranty'];
|
||||
return [...(contract.value?.nodes || [])].sort((left, right) => order.indexOf(left.node_type) - order.indexOf(right.node_type));
|
||||
@@ -189,13 +194,13 @@ function alertsForNode(node: PaymentNode) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载当前路由合同的完整详情。
|
||||
* 核心逻辑:ID 非法时返回台账;接口失败保留空态并展示统一业务错误。
|
||||
* 加载当前合同的完整详情。
|
||||
* 核心逻辑:ID 非法时通知父级关闭下钻;接口失败保留空态并展示统一业务错误。
|
||||
* @returns 完成后更新详情数据及加载状态。
|
||||
*/
|
||||
async function load(): Promise<void> {
|
||||
if (!Number.isInteger(contractId.value) || contractId.value <= 0) {
|
||||
await router.replace(WORKSPACE_PATHS.contractPayment);
|
||||
emit('close');
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
@@ -254,14 +259,17 @@ async function reparseContract(): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回合同付款预警台账。
|
||||
* 核心逻辑:使用路由常量而非浏览器历史,避免从周汇总或外部链接进入详情时返回错误页面。
|
||||
* @returns 路由跳转完成。
|
||||
* 返回当前 Tab 的合同列表。
|
||||
* 核心逻辑:由 Chat 父级清掉 contractId,避免从待确认下钻后误回到台账。
|
||||
*/
|
||||
async function backToLedger(): Promise<void> {
|
||||
await router.push(WORKSPACE_PATHS.contractPayment);
|
||||
function backToLedger(): void {
|
||||
emit('close');
|
||||
}
|
||||
|
||||
watch(contractId, () => {
|
||||
void load();
|
||||
});
|
||||
|
||||
onMounted(() => void load());
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
<!--
|
||||
合同付款预警工作台:展示汇总卡、合同台账、付款阶段字段、本周待发送摘要;同步/扫描/发送仅管理员可见。
|
||||
依赖:contract-payment.api、PaginationBar、useAuthStore、统一消息提示;周汇总批次由独立页面展示。
|
||||
features/contract-payment/views/ContractPaymentPage.vue
|
||||
用途:合同付款预警台账列表、汇总卡与本周待发送摘要。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:Chat Tab 以 embedded 嵌入时隐藏页头;点行通过 open-detail 交给父级下钻详情。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { CalendarClock, RefreshCw, Search, Send } from 'lucide-vue-next';
|
||||
import { Search } from 'lucide-vue-next';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import PaginationBar from '@/shared/components/PaginationBar.vue';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import { WORKSPACE_PATHS } from '@/features/workspace/constants/routes';
|
||||
import {
|
||||
enqueueContractPaymentAlertScan,
|
||||
enqueueContractPaymentReparse,
|
||||
enqueueContractPaymentSync,
|
||||
enqueueContractPaymentWeeklyAlert,
|
||||
getContractPaymentAlertSummary,
|
||||
getContractPaymentLedgerSummary,
|
||||
listContractPaymentContracts,
|
||||
@@ -29,22 +23,25 @@ import {
|
||||
import { displayCurrency } from '../utils/currency';
|
||||
import { aggregateContractNodeStatus, type ContractNodeStatusCode } from '../utils/paymentStatus';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
}>(), { embedded: false });
|
||||
|
||||
const emit = defineEmits<{
|
||||
'open-detail': [contractId: number];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
const isAdmin = computed(() => auth.isAdmin);
|
||||
const msg = useMessage(); const keyword = ref(''); const loading = ref(false); const actionLoading = ref(false);
|
||||
const showForceSyncConfirm = ref(false);
|
||||
const showReparseExistingConfirm = ref(false);
|
||||
const msg = useMessage(); const keyword = ref(''); const loading = ref(false);
|
||||
const contracts = ref<ContractPaymentContract[]>([]);
|
||||
const alertSummary = ref<AlertSummary | null>(null);
|
||||
const ledgerSummary = ref<LedgerSummary>({ due: 0, overdue: 0, needs_completion: 0, due_this_month: 0 });
|
||||
const ledgerSummary = ref<LedgerSummary>({ due: 0, overdue: 0, active: 0, due_this_month: 0 });
|
||||
const ledgerFocus = ref<LedgerFocus | ''>('');
|
||||
const page = ref(1); const pageSize = ref(20); const total = ref(0); const pages = ref(1);
|
||||
const ledgerFocusCards = computed(() => ([
|
||||
{ key: 'due' as const, label: t('admin.contractPayment.ledgerFocus.due'), hint: t('admin.contractPayment.ledgerFocus.dueHint'), value: ledgerSummary.value.due, tone: 'due' },
|
||||
{ key: 'overdue' as const, label: t('admin.contractPayment.ledgerFocus.overdue'), hint: '', value: ledgerSummary.value.overdue, tone: 'overdue' },
|
||||
{ key: 'needs_completion' as const, label: t('admin.contractPayment.ledgerFocus.needsCompletion'), hint: '', value: ledgerSummary.value.needs_completion, tone: 'needs' },
|
||||
{ key: 'active' as const, label: t('admin.contractPayment.ledgerFocus.active'), hint: '', value: ledgerSummary.value.active, tone: 'in-progress' },
|
||||
{ key: 'due_this_month' as const, label: t('admin.contractPayment.ledgerFocus.dueThisMonth'), hint: t('admin.contractPayment.ledgerFocus.dueThisMonthHint'), value: ledgerSummary.value.due_this_month, tone: 'month' },
|
||||
]));
|
||||
const stage = (item: ContractPaymentContract, name: string) => item.nodes.find((node) => node.node_type === name);
|
||||
@@ -189,80 +186,27 @@ function toggleLedgerFocus(key: LedgerFocus): void {
|
||||
void load(true);
|
||||
}
|
||||
/**
|
||||
* 提交合同付款预警后台任务。
|
||||
* 核心逻辑:仅管理员可提交;按操作类型调用相应的异步接口,任务入队成功后仅展示任务编号,不等待长耗时同步或发送完成。
|
||||
* @param action - sync 同步 OA、force-sync 强制覆盖、reparse-existing 刷新存量解析、scan 扫描预警、weekly 周汇总。
|
||||
* @returns 任务提交完成后显示成功或失败提示。
|
||||
* 打开合同详情。
|
||||
* 核心逻辑:Chat 父级用 open-detail 在当前 Tab 内下钻;不再跳工作台路由。
|
||||
*/
|
||||
async function submitAction(action: 'sync' | 'force-sync' | 'reparse-existing' | 'scan' | 'weekly'): Promise<void> {
|
||||
if (!isAdmin.value) return;
|
||||
actionLoading.value = true;
|
||||
try {
|
||||
if (action === 'sync' || action === 'force-sync') {
|
||||
await enqueueContractPaymentSync(action === 'force-sync');
|
||||
} else if (action === 'reparse-existing') {
|
||||
await enqueueContractPaymentReparse();
|
||||
} else if (action === 'scan') {
|
||||
await enqueueContractPaymentAlertScan();
|
||||
} else {
|
||||
await enqueueContractPaymentWeeklyAlert();
|
||||
}
|
||||
msg.success(t('admin.contractPayment.jobSubmitted'));
|
||||
if (action === 'scan' || action === 'weekly') {
|
||||
await refreshSummary();
|
||||
}
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPayment.actionFailed'));
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 触发任务入口;强制覆盖同步先弹出统一确认框,其余直接提交。
|
||||
* 核心逻辑:用公共确认组件替代原生 confirm,避免浏览器差异;确认后仍走统一的提交逻辑。
|
||||
* @param action - 待提交的预警任务类型。
|
||||
*/
|
||||
function run(action: 'sync' | 'force-sync' | 'reparse-existing' | 'scan' | 'weekly'): void {
|
||||
if (!isAdmin.value) return;
|
||||
if (action === 'force-sync') {
|
||||
showForceSyncConfirm.value = true;
|
||||
return;
|
||||
}
|
||||
if (action === 'reparse-existing') {
|
||||
showReparseExistingConfirm.value = true;
|
||||
return;
|
||||
}
|
||||
void submitAction(action);
|
||||
}
|
||||
/** 强制覆盖同步确认后的提交回调。 */
|
||||
function confirmForceSync(): void {
|
||||
void submitAction('force-sync');
|
||||
}
|
||||
/** 存量合同批量重解析确认后的提交回调。 */
|
||||
function confirmReparseExisting(): void {
|
||||
void submitAction('reparse-existing');
|
||||
}
|
||||
/**
|
||||
* 进入所选合同的付款计划和预警审计详情。
|
||||
* 核心逻辑:仅使用台账已返回的内部主键构造路由,合同编号为空时仍可安全查看详情。
|
||||
* @param contractId - 合同台账主键。
|
||||
* @returns 详情路由跳转完成。
|
||||
*/
|
||||
async function openContractDetail(contractId: number): Promise<void> {
|
||||
await router.push(WORKSPACE_PATHS.contractPaymentDetail(contractId));
|
||||
function openContractDetail(contractId: number): void {
|
||||
emit('open-detail', contractId);
|
||||
}
|
||||
onMounted(() => void load());
|
||||
</script>
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4"><div><h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.title') }}</h2><p class="text-sm text-muted mt-1">{{ t('admin.contractPayment.subtitle') }}</p></div><div v-if="isAdmin" class="flex flex-wrap gap-2"><button class="btn-secondary-ds" :disabled="actionLoading" @click="run('sync')"><RefreshCw class="w-4 h-4" />{{ t('admin.contractPayment.sync') }}</button><button class="btn-secondary-ds" :disabled="actionLoading" @click="run('force-sync')"><RefreshCw class="w-4 h-4" />{{ t('admin.contractPayment.forceSync') }}</button><button class="btn-secondary-ds" :disabled="actionLoading" @click="run('reparse-existing')"><RefreshCw class="w-4 h-4" />{{ t('admin.contractPayment.reparseExisting') }}</button><button class="btn-secondary-ds" :disabled="actionLoading" @click="run('scan')"><CalendarClock class="w-4 h-4" />{{ t('admin.contractPayment.scanAlerts') }}</button><button class="btn-primary" :disabled="actionLoading" @click="run('weekly')"><Send class="w-4 h-4" />{{ t('admin.contractPayment.weeklySend') }}</button></div></div>
|
||||
<div v-if="!props.embedded" class="mb-4">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.title') }}</h2>
|
||||
<p class="text-sm text-muted mt-1">{{ t('admin.contractPayment.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="contract-stat-grid">
|
||||
<button
|
||||
v-for="card in ledgerFocusCards"
|
||||
:key="card.key"
|
||||
type="button"
|
||||
class="contract-stat-card"
|
||||
:class="[card.tone, { active: ledgerFocus === card.key }]"
|
||||
:class="[card.tone, { 'is-selected': ledgerFocus === card.key }]"
|
||||
@click="toggleLedgerFocus(card.key)"
|
||||
>
|
||||
<span class="contract-stat-label">{{ card.label }}<small v-if="card.hint">({{ card.hint }})</small></span>
|
||||
@@ -302,22 +246,6 @@ onMounted(() => void load());
|
||||
</table>
|
||||
</div>
|
||||
<PaginationBar v-model:page="page" v-model:page-size="pageSize" :total="total" :pages="pages" :visible="total > 0 || !!keyword.trim() || !!ledgerFocus" @update:page="() => load()" @update:page-size="() => load()" />
|
||||
<DeleteConfirmDialog
|
||||
v-if="isAdmin"
|
||||
v-model="showForceSyncConfirm"
|
||||
:title="t('admin.contractPayment.forceSync')"
|
||||
:message="t('admin.contractPayment.forceSyncConfirm')"
|
||||
confirm-tone="primary"
|
||||
@confirm="confirmForceSync"
|
||||
/>
|
||||
<DeleteConfirmDialog
|
||||
v-if="isAdmin"
|
||||
v-model="showReparseExistingConfirm"
|
||||
:title="t('admin.contractPayment.reparseExisting')"
|
||||
:message="t('admin.contractPayment.reparseExistingConfirm')"
|
||||
confirm-tone="primary"
|
||||
@confirm="confirmReparseExisting"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
<style scoped>
|
||||
@@ -340,13 +268,13 @@ onMounted(() => void load());
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.contract-stat-card.active { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59, 130, 246, .16); }
|
||||
.contract-stat-card.is-selected { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59, 130, 246, .16); }
|
||||
.contract-stat-label { color: #8aa0bd; font-size: 12px; font-weight: 600; line-height: 1.35; }
|
||||
.contract-stat-label small { margin-left: 2px; font-size: 12px; font-weight: 600; }
|
||||
.contract-stat-value { margin-top: 8px; font-size: 28px; font-weight: 800; line-height: 1; }
|
||||
.contract-stat-card.due .contract-stat-value { color: #d97706; }
|
||||
.contract-stat-card.overdue .contract-stat-value { color: #dc2626; }
|
||||
.contract-stat-card.needs .contract-stat-value { color: #0f172a; }
|
||||
.contract-stat-card.in-progress .contract-stat-value { color: #2563eb; }
|
||||
.contract-stat-card.month .contract-stat-value { color: #16a34a; }
|
||||
@media (max-width: 900px) { .contract-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
.contract-filter-bar {
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
<!--
|
||||
features/contract-payment/views/ContractPaymentReviewPage.vue
|
||||
用途:集中展示关键解析事实缺失或冲突的合同,供管理员下载原文并人工确认。
|
||||
依赖:contract-payment.api、PaginationBar、工作台路由与统一消息提示。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;页面不推导付款节点,也不触发预警任务。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;Chat 父级通过 open-detail 下钻详情。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Search } from 'lucide-vue-next';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import PaginationBar from '@/shared/components/PaginationBar.vue';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { WORKSPACE_PATHS } from '@/features/workspace/constants/routes';
|
||||
import { listContractPaymentContracts, type ContractPaymentContract } from '../api/contract-payment.api';
|
||||
|
||||
const router = useRouter();
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
}>(), { embedded: false });
|
||||
|
||||
const emit = defineEmits<{
|
||||
'open-detail': [contractId: number];
|
||||
}>();
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
const keyword = ref('');
|
||||
@@ -56,8 +60,8 @@ async function load(resetPage = false): Promise<void> {
|
||||
* @param contractId - 合同付款台账主键。
|
||||
* @returns 路由跳转完成。
|
||||
*/
|
||||
async function openContractDetail(contractId: number): Promise<void> {
|
||||
await router.push(WORKSPACE_PATHS.contractPaymentDetail(contractId));
|
||||
function openContractDetail(contractId: number): void {
|
||||
emit('open-detail', contractId);
|
||||
}
|
||||
|
||||
onMounted(() => void load());
|
||||
@@ -65,7 +69,10 @@ onMounted(() => void load());
|
||||
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div><h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPaymentReview.title') }}</h2><p class="mt-1 text-sm text-muted">{{ t('admin.contractPaymentReview.subtitle') }}</p></div>
|
||||
<div v-if="!props.embedded">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPaymentReview.title') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPaymentReview.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="contract-filter-bar">
|
||||
<div class="contract-filter-search">
|
||||
<Search class="contract-filter-icon" />
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
<!--
|
||||
features/contract-payment/views/ContractPaymentWeeklyBatchesPage.vue
|
||||
用途:独立展示合同付款预警的周汇总批次及其企业微信发送审计摘要,并下载 Excel 明细。
|
||||
依赖:contract-payment.api、useAuthStore、统一消息提示;由工作台“合同付款预警 > 周汇总批次”路由加载。
|
||||
逻辑:后端扫描产生的批次在此集中查看;Excel 经受控接口下载;手动发送仅管理员可见并提交异步任务。
|
||||
依赖:contract-payment.api、统一消息提示。
|
||||
逻辑:后端扫描产生的批次在此集中查看;Excel 经受控接口下载;Chat 顶栏共用发送入口,本页 embedded 时隐藏页头与发送按钮。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { CalendarClock, Download, Send } from 'lucide-vue-next';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { CalendarClock, Download } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import { formatLocalDateTime } from '@/shared/utils/dateTime';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import {
|
||||
downloadContractPaymentAlertBatchExcel,
|
||||
enqueueContractPaymentWeeklyAlert,
|
||||
listContractPaymentAlertBatches,
|
||||
type AlertBatch,
|
||||
} from '../api/contract-payment.api';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
embedded?: boolean;
|
||||
}>(), { embedded: false });
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const isAdmin = computed(() => auth.isAdmin);
|
||||
const msg = useMessage();
|
||||
const batches = ref<AlertBatch[]>([]);
|
||||
const loading = ref(false);
|
||||
const actionLoading = ref(false);
|
||||
const downloadingId = ref<number | null>(null);
|
||||
|
||||
/**
|
||||
@@ -45,25 +44,6 @@ async function load(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动提交本周汇总发送任务。
|
||||
* 核心逻辑:仅管理员可调用异步入队接口,避免浏览器等待企业微信发送和 Excel 文件生成完成。
|
||||
* @returns 提交结果通过统一消息提示反馈,成功后刷新批次列表。
|
||||
*/
|
||||
async function runWeeklyAlert(): Promise<void> {
|
||||
if (!isAdmin.value) return;
|
||||
actionLoading.value = true;
|
||||
try {
|
||||
await enqueueContractPaymentWeeklyAlert();
|
||||
msg.success(t('admin.contractPayment.weeklyBatchSubmitted'));
|
||||
await load();
|
||||
} catch (error) {
|
||||
msg.error(error instanceof BusinessError ? error.message : t('admin.contractPayment.actionFailed'));
|
||||
} finally {
|
||||
actionLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断批次是否已归档 Excel,供下载按钮启用。
|
||||
* 核心逻辑:文件名或大小任一存在即视为可下载;真正有无字节由下载接口校验。
|
||||
@@ -127,16 +107,9 @@ onMounted(() => void load());
|
||||
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.weeklyBatchesTitle') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPayment.weeklyBatchesSubtitle') }}</p>
|
||||
</div>
|
||||
<div v-if="isAdmin" class="flex gap-2">
|
||||
<button class="btn-primary" :disabled="actionLoading" @click="runWeeklyAlert">
|
||||
<Send class="h-4 w-4" />{{ t('admin.contractPayment.weeklySend') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="!props.embedded">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.weeklyBatchesTitle') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPayment.weeklyBatchesSubtitle') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="surface-panel mt-5 overflow-x-auto rounded-2xl">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/workspace/api/voucherCheck.api.ts
|
||||
* 用途:工作台立账凭证检核任务列表、批次明细、企微发送记录与强制重检 API 客户端。
|
||||
* 用途:工作台立账凭证检核任务列表、最近一次检核、批次明细、企微发送记录与强制重检 API 客户端。
|
||||
* 依赖:@/shared/api/client、getAuthHeaders。
|
||||
* 逻辑:AccountingVoucherCheckView / DetailView 调用;对应 /api/workspace/accounting-voucher-check/* 与排程 Excel 下载。
|
||||
*/
|
||||
@@ -71,8 +71,45 @@ export interface VoucherCheckForceRunResponse {
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface VoucherCheckLatestStep {
|
||||
step: string;
|
||||
label?: string | null;
|
||||
processed_count: number;
|
||||
}
|
||||
|
||||
export interface VoucherCheckLatestRun {
|
||||
schedule_run_id: number | null;
|
||||
engine_run_id?: number | null;
|
||||
run_no: string;
|
||||
period_month: string | null;
|
||||
mode: string;
|
||||
status: string;
|
||||
progress_percent: number;
|
||||
subject_count: number;
|
||||
archived_file_count: number;
|
||||
missing_file_count: number;
|
||||
missing_invoice_count: number;
|
||||
processed_count: number;
|
||||
started_at?: string | null;
|
||||
finished_at?: string | null;
|
||||
error_message?: string | null;
|
||||
current_step?: VoucherCheckLatestStep | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取最近一次立账凭证检核(含排队/执行中),不跟列表 period/status。
|
||||
* @returns 无任何批次时为 null
|
||||
*/
|
||||
export function getLatestVoucherCheckRun() {
|
||||
return requestJson<VoucherCheckLatestRun | null>(
|
||||
'/api/workspace/accounting-voucher-check/runs/latest',
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询检核任务列表。
|
||||
* @param params.period - YYYY 表示该年全部月份,YYYY-MM 表示单月
|
||||
*/
|
||||
export function listVoucherCheckRuns(params: {
|
||||
period?: string;
|
||||
@@ -136,6 +173,7 @@ export interface VoucherCheckNotificationsResponse {
|
||||
|
||||
/**
|
||||
* 分页查询企微缺件汇总发送记录。
|
||||
* @param params.period - YYYY 表示该年全部月份,YYYY-MM 表示单月
|
||||
*/
|
||||
export function listVoucherCheckNotifications(params?: {
|
||||
period?: string;
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/components/WorkspaceSidebar.vue
|
||||
* 工作台左侧导航:子路由链接、货代/合同付款二级菜单、关联服务入口、返回聊天与退出登录。
|
||||
* 依赖:WORKSPACE_PATHS、workspace.context、ExternalSystemLinks、auth.store、contract-payment 权限常量。
|
||||
* 逻辑:底部关联服务复用 ws-nav-btn,与返回聊天/退出登录对齐;合同付款菜单仅在具备 contract_payment.access 时展示。
|
||||
* 工作台左侧导航:子路由链接、货代二级菜单、关联服务入口、返回聊天与退出登录。
|
||||
* 依赖:WORKSPACE_PATHS、workspace.context、ExternalSystemLinks。
|
||||
* 逻辑:底部关联服务复用 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, CalendarClock,
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen, ClipboardCheck,
|
||||
ChevronDown, ChevronRight, ContactRound, Inbox, FileDown,
|
||||
} from 'lucide-vue-next';
|
||||
import { WORKSPACE_PATHS } from '../constants/routes';
|
||||
import { WORKSPACE_KEY } from '../composables/workspace.context';
|
||||
import { useShippingTodoBadge } from '../composables/useShippingTodoBadge';
|
||||
import { ExternalSystemLinks } from '@/features/sso';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import { CONTRACT_PAYMENT_ACCESS_PERMISSION } from '@/features/contract-payment/constants';
|
||||
|
||||
const props = defineProps<{
|
||||
collapsed?: boolean;
|
||||
@@ -27,15 +25,7 @@ const ws = inject(WORKSPACE_KEY)! as any;
|
||||
const route = useRoute();
|
||||
const shippingRouteNames = ['workspace-shipping-customers', 'workspace-shipping-tasks', 'workspace-shipping-my-tasks'] as const;
|
||||
const shippingExpanded = ref(false);
|
||||
const contractPaymentRouteNames = ['workspace-contract-payment', 'workspace-contract-payment-review', 'workspace-contract-payment-weekly-batches'] as const;
|
||||
const contractPaymentExpanded = ref(false);
|
||||
const isAdmin = computed(() => String(ws.currentUser?.role || '').trim().toLowerCase() === 'admin');
|
||||
const auth = useAuthStore();
|
||||
/**
|
||||
* 当前用户是否可看见并进入合同付款预警工作台。
|
||||
* 核心逻辑:读取登录态 feature_permissions.contract_payment.access;admin 默认 true,普通用户需显式授予。
|
||||
*/
|
||||
const canAccessContractPayment = computed(() => auth.hasFeaturePermission(CONTRACT_PAYMENT_ACCESS_PERMISSION));
|
||||
const { pendingBadge, startShippingTodoBadgePolling, stopShippingTodoBadgePolling } = useShippingTodoBadge();
|
||||
|
||||
const primaryLinkItems = [
|
||||
@@ -61,16 +51,13 @@ function isActive(match: readonly string[]) {
|
||||
return match.includes(String(route.name || ''));
|
||||
}
|
||||
|
||||
/** 当前路由进入货代或合同付款子页面时自动展开对应一级菜单,保证激活项可见。 */
|
||||
/** 当前路由进入货代子页面时自动展开对应一级菜单,保证激活项可见。 */
|
||||
watch(
|
||||
() => route.name,
|
||||
(routeName) => {
|
||||
if (shippingRouteNames.includes(String(routeName || '') as typeof shippingRouteNames[number])) {
|
||||
shippingExpanded.value = true;
|
||||
}
|
||||
if (contractPaymentRouteNames.includes(String(routeName || '') as typeof contractPaymentRouteNames[number])) {
|
||||
contractPaymentExpanded.value = true;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
@@ -84,15 +71,6 @@ const toggleShippingMenu = (): void => {
|
||||
shippingExpanded.value = !shippingExpanded.value;
|
||||
};
|
||||
|
||||
/** 展开或收起合同付款预警目录;侧栏折叠时图标直接进入合同台账。 */
|
||||
const toggleContractPaymentMenu = (): void => {
|
||||
if (props.collapsed) {
|
||||
void ws.router.push(WORKSPACE_PATHS.contractPayment);
|
||||
return;
|
||||
}
|
||||
contractPaymentExpanded.value = !contractPaymentExpanded.value;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
startShippingTodoBadgePolling();
|
||||
});
|
||||
@@ -199,48 +177,6 @@ onBeforeUnmount(() => {
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="canAccessContractPayment">
|
||||
<button
|
||||
type="button"
|
||||
class="ws-nav-btn w-full"
|
||||
:class="[
|
||||
{ 'ws-nav-btn--active': isActive(contractPaymentRouteNames) },
|
||||
collapsed ? 'justify-center px-0' : '',
|
||||
]"
|
||||
:title="$t('workspace.nav.contractPayment')"
|
||||
@click="toggleContractPaymentMenu"
|
||||
>
|
||||
<CalendarClock class="h-[18px] w-[18px]" />
|
||||
<span v-if="!collapsed" class="flex-1">{{ $t('workspace.nav.contractPayment') }}</span>
|
||||
<component v-if="!collapsed" :is="contractPaymentExpanded ? ChevronDown : ChevronRight" class="h-4 w-4" />
|
||||
</button>
|
||||
<div v-if="!collapsed && contractPaymentExpanded" class="mt-1 space-y-1 pl-5">
|
||||
<RouterLink
|
||||
:to="WORKSPACE_PATHS.contractPayment"
|
||||
class="ws-nav-btn py-2.5 text-[13px]"
|
||||
:class="{ 'ws-nav-btn--active': isActive(['workspace-contract-payment']) }"
|
||||
>
|
||||
<CalendarClock class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.contractPaymentLedger') }}</span>
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
:to="WORKSPACE_PATHS.contractPaymentReview"
|
||||
class="ws-nav-btn py-2.5 text-[13px]"
|
||||
:class="{ 'ws-nav-btn--active': isActive(['workspace-contract-payment-review']) }"
|
||||
>
|
||||
<ClipboardCheck class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.contractPaymentReview') }}</span>
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
:to="WORKSPACE_PATHS.contractPaymentWeeklyBatches"
|
||||
class="ws-nav-btn py-2.5 text-[13px]"
|
||||
:class="{ 'ws-nav-btn--active': isActive(['workspace-contract-payment-weekly-batches']) }"
|
||||
>
|
||||
<Inbox class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.contractPaymentWeeklyBatches') }}</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
<RouterLink
|
||||
v-for="item in secondaryLinkItems"
|
||||
:key="item.path"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* features/workspace/constants/routes.ts
|
||||
* 工作台子路由 path 常量,以及旧 ?view= 查询参数到新 path 的映射。
|
||||
* 立账凭证批次明细:accountingVoucherCheckDetail(scheduleRunId)。
|
||||
* 合同付款路径仍保留,供旧书签落到 Chat 重定向页。
|
||||
*/
|
||||
export const WORKSPACE_PATHS = {
|
||||
root: '/workspace',
|
||||
|
||||
@@ -24,7 +24,6 @@ export type WorkspaceSidebarItem =
|
||||
| 'schedule_runs'
|
||||
| 'receipt_reports'
|
||||
| 'shipping_notice'
|
||||
| 'contract_payment'
|
||||
| 'history';
|
||||
|
||||
export interface WorkspaceAgent {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/workspace/utils/voucherCheck.display.ts
|
||||
* 用途:立账凭证检核列表与明细页共用的状态文案、缺件列表、缺件数、缺失占比与企微发送状态展示。
|
||||
* 用途:立账凭证检核列表、最近一次检核卡片与明细页共用的状态/模式/步骤文案。
|
||||
* 依赖:vue-i18n 的 t()。
|
||||
* 逻辑:AccountingVoucherCheckView / AccountingVoucherCheckDetailView 调用。
|
||||
*/
|
||||
@@ -18,9 +18,37 @@ export function voucherCheckStatusLabel(t: (key: string) => string, value: strin
|
||||
if (value === 'technical_error' || value === 'technical_failed') return t('workspace.voucherCheck.statusTechError');
|
||||
if (value === 'failed') return t('workspace.voucherCheck.statusTechError');
|
||||
if (value === 'pending') return t('workspace.voucherCheck.statusPending');
|
||||
if (value === 'queued') return t('workspace.voucherCheck.statusQueued');
|
||||
if (value === 'running') return t('workspace.voucherCheck.statusRunning');
|
||||
return value || '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* 将批次执行模式映射为工作台文案。
|
||||
* @param t - i18n 翻译函数
|
||||
* @param value - incremental / force_all / single
|
||||
*/
|
||||
export function voucherCheckModeLabel(t: (key: string) => string, value: string): string {
|
||||
if (value === 'force_all') return t('workspace.voucherCheck.modeForceAll');
|
||||
if (value === 'single') return t('workspace.voucherCheck.modeSingle');
|
||||
return t('workspace.voucherCheck.modeIncremental');
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 runner 步骤码映射为工作台当前步骤文案。
|
||||
* @param t - i18n 翻译函数
|
||||
* @param step - current_step.step
|
||||
*/
|
||||
export function voucherCheckStepLabel(t: (key: string) => string, step?: string | null): string {
|
||||
if (step === 'queued') return t('workspace.voucherCheck.stepQueued');
|
||||
if (step === 'fetch_erp') return t('workspace.voucherCheck.stepFetchErp');
|
||||
if (step === 'scan_dms') return t('workspace.voucherCheck.stepScanDms');
|
||||
if (step === 'persist') return t('workspace.voucherCheck.stepPersist');
|
||||
if (step === 'notify') return t('workspace.voucherCheck.stepNotify');
|
||||
if (step === 'done') return t('workspace.voucherCheck.stepDone');
|
||||
return step || '-';
|
||||
}
|
||||
|
||||
/**
|
||||
* 将企微汇总发送状态码映射为工作台文案。
|
||||
* @param t - i18n 翻译函数
|
||||
|
||||
@@ -1,28 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/views/AccountingVoucherCheckView.vue
|
||||
* 用途:立账凭证检核任务列表——按资料所属期间查看批次统计。
|
||||
* 依赖:voucherCheck.api、vue-i18n、useMessage、DeleteConfirmDialog、PaginationBar、formatLocalDateTime、voucherCheck.display。
|
||||
* 逻辑:路由 /workspace/accounting-voucher-check;Tab 切换检核任务与企微发送记录;查看详情进入独立明细页;企微 ?run_id= 重定向到明细路由。
|
||||
* 用途:立账凭证检核任务列表——按资料所属期间(年 + 月)查看批次统计,并展示最近一次检核进度。
|
||||
* 依赖:voucherCheck.api、vue-i18n、useMessage、DeleteConfirmDialog、PaginationBar、formatLocalDateTime、voucherCheck.display、auth。
|
||||
* 逻辑:路由 /workspace/accounting-voucher-check;进页默认上一个自然月;「最近一次检核」不跟筛选;强制重检仅 admin,进度在本卡轮询。
|
||||
*/
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Download, Loader2, RefreshCw, RotateCcw, Search } from 'lucide-vue-next';
|
||||
import { ChevronDown, Download, Loader2, RotateCcw, Search } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import PaginationBar from '@/shared/components/PaginationBar.vue';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { getStoredAuthUser } from '@/shared/utils/auth';
|
||||
import { formatLocalDateTime } from '@/shared/utils/dateTime';
|
||||
import { WORKSPACE_PATHS } from '../constants/routes';
|
||||
import {
|
||||
downloadVoucherCheckExcel,
|
||||
getLatestVoucherCheckRun,
|
||||
listVoucherCheckNotifications,
|
||||
listVoucherCheckRuns,
|
||||
triggerVoucherCheckForceAll,
|
||||
type VoucherCheckLatestRun,
|
||||
type VoucherCheckNotificationItem,
|
||||
type VoucherCheckRunItem,
|
||||
} from '../api/voucherCheck.api';
|
||||
import { voucherCheckNotifyStatusLabel, voucherCheckStatusLabel } from '../utils/voucherCheck.display';
|
||||
import {
|
||||
voucherCheckModeLabel,
|
||||
voucherCheckNotifyStatusLabel,
|
||||
voucherCheckStatusLabel,
|
||||
voucherCheckStepLabel,
|
||||
} from '../utils/voucherCheck.display';
|
||||
|
||||
const { t } = useI18n();
|
||||
const msg = useMessage();
|
||||
@@ -36,7 +44,8 @@ const items = ref<VoucherCheckRunItem[]>([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = ref(50);
|
||||
const period = ref('');
|
||||
const periodYear = ref('');
|
||||
const periodMonth = ref('');
|
||||
const status = ref('');
|
||||
const listTab = ref<'tasks' | 'notifications'>('tasks');
|
||||
const notifyLoading = ref(false);
|
||||
@@ -45,19 +54,63 @@ const notifyTotal = ref(0);
|
||||
const notifyPage = ref(1);
|
||||
const notifyPageSize = ref(50);
|
||||
const notifyStatus = ref('');
|
||||
const latestRun = ref<VoucherCheckLatestRun | null>(null);
|
||||
const latestLoading = ref(false);
|
||||
let forcePollTimer: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
const isAdmin = computed(() => String(getStoredAuthUser()?.role || '').trim().toLowerCase() === 'admin');
|
||||
const latestInProgress = computed(() => {
|
||||
const cardStatus = latestRun.value?.status;
|
||||
return cardStatus === 'queued' || cardStatus === 'running';
|
||||
});
|
||||
const latestHasMissing = computed(() => {
|
||||
const row = latestRun.value;
|
||||
if (!row) return false;
|
||||
return (row.missing_file_count || 0) > 0 || (row.missing_invoice_count || 0) > 0;
|
||||
});
|
||||
const latestCanOpenDetail = computed(() => {
|
||||
const row = latestRun.value;
|
||||
if (!row?.schedule_run_id) return false;
|
||||
return row.status === 'missing' || row.status === 'completed';
|
||||
});
|
||||
|
||||
const MONTH_VALUES = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] as const;
|
||||
|
||||
/**
|
||||
* 默认资料所属期间为上一个自然月 YYYY-MM。
|
||||
* 进页默认资料所属期间为上一个自然月。
|
||||
*/
|
||||
function previousPeriod(): string {
|
||||
function previousYearMonth(): { year: string; month: string } {
|
||||
const d = new Date();
|
||||
d.setDate(1);
|
||||
d.setMonth(d.getMonth() - 1);
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0');
|
||||
return `${d.getFullYear()}-${m}`;
|
||||
return {
|
||||
year: String(d.getFullYear()),
|
||||
month: String(d.getMonth() + 1).padStart(2, '0'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装列表查询 period:有月份则为 YYYY-MM,否则为 YYYY。
|
||||
*/
|
||||
const periodQuery = computed(() => {
|
||||
if (!periodYear.value) return undefined;
|
||||
if (periodMonth.value) return `${periodYear.value}-${periodMonth.value}`;
|
||||
return periodYear.value;
|
||||
});
|
||||
|
||||
const yearOptions = computed(() => {
|
||||
const now = new Date().getFullYear();
|
||||
const years: string[] = [];
|
||||
for (let year = now - 5; year <= now; year += 1) {
|
||||
years.push(String(year));
|
||||
}
|
||||
if (periodYear.value && !years.includes(periodYear.value)) {
|
||||
years.unshift(periodYear.value);
|
||||
years.sort();
|
||||
}
|
||||
return years;
|
||||
});
|
||||
|
||||
const statusOptions = computed(() => [
|
||||
{ value: '', label: t('workspace.voucherCheck.statusAll') },
|
||||
{ value: 'missing', label: t('workspace.voucherCheck.statusMissing') },
|
||||
@@ -89,7 +142,7 @@ async function loadNotifications() {
|
||||
notifyLoading.value = true;
|
||||
try {
|
||||
const data = await listVoucherCheckNotifications({
|
||||
period: period.value || undefined,
|
||||
period: periodQuery.value,
|
||||
send_status: notifyStatus.value || undefined,
|
||||
page: notifyPage.value,
|
||||
page_size: notifyPageSize.value,
|
||||
@@ -117,6 +170,7 @@ function setListTab(tab: 'tasks' | 'notifications') {
|
||||
}
|
||||
page.value = 1;
|
||||
void loadRuns();
|
||||
void loadLatestRun();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,17 +186,6 @@ function searchCurrentTab() {
|
||||
void loadNotifications();
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前 Tab 刷新列表,不重置页码。
|
||||
*/
|
||||
function refreshCurrentTab() {
|
||||
if (listTab.value === 'tasks') {
|
||||
void loadRuns();
|
||||
return;
|
||||
}
|
||||
void loadNotifications();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载该发送记录对应批次的 Excel。
|
||||
* @param row - 企微发送记录
|
||||
@@ -197,7 +240,7 @@ async function loadRuns() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const data = await listVoucherCheckRuns({
|
||||
period: period.value || undefined,
|
||||
period: periodQuery.value,
|
||||
status: status.value || undefined,
|
||||
page: page.value,
|
||||
page_size: pageSize.value,
|
||||
@@ -238,15 +281,96 @@ function openRunDetail(row: VoucherCheckRunItem) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止强制重检后的列表轮询。
|
||||
* 停止最近一次检核的进度轮询。
|
||||
*/
|
||||
function stopForcePoll() {
|
||||
function stopLatestPoll() {
|
||||
if (forcePollTimer) {
|
||||
clearInterval(forcePollTimer);
|
||||
forcePollTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取最近一次检核卡片;不跟下方列表的年/月/状态筛选。
|
||||
* @param options.silent - 轮询时不切换卡片 loading,避免进度条闪烁
|
||||
*/
|
||||
async function loadLatestRun(options?: { silent?: boolean }) {
|
||||
if (!options?.silent) latestLoading.value = true;
|
||||
try {
|
||||
latestRun.value = await getLatestVoucherCheckRun();
|
||||
} catch (e: any) {
|
||||
if (!options?.silent) {
|
||||
msg.error(e?.message || t('workspace.voucherCheck.latestLoadFailed'));
|
||||
}
|
||||
} finally {
|
||||
if (!options?.silent) latestLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 排队或执行中时轮询卡片;进入终态后刷新下方列表。
|
||||
*/
|
||||
function syncLatestPoll() {
|
||||
stopLatestPoll();
|
||||
if (listTab.value !== 'tasks' || !latestInProgress.value) return;
|
||||
forcePollTimer = setInterval(() => {
|
||||
void (async () => {
|
||||
const previous = latestRun.value?.status;
|
||||
await loadLatestRun({ silent: true });
|
||||
const next = latestRun.value?.status;
|
||||
if ((previous === 'queued' || previous === 'running') && next !== 'queued' && next !== 'running') {
|
||||
stopLatestPoll();
|
||||
void loadRuns();
|
||||
}
|
||||
})();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 最近一次检核状态徽章样式。
|
||||
* @param value - 卡片状态
|
||||
*/
|
||||
function latestBadgeClass(value: string): string {
|
||||
if (value === 'missing' || value === 'technical_failed') return 'bg-rose-50 text-rose-700';
|
||||
if (value === 'completed') return 'bg-emerald-50 text-emerald-700';
|
||||
if (value === 'queued' || value === 'running') return 'bg-blue-50 text-blue-700';
|
||||
return 'bg-surface-soft text-secondary';
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片当前步骤主文案:终态用完成提示,其余按步骤码翻译。
|
||||
* @param row - 最近一次检核
|
||||
*/
|
||||
function latestStepText(row: VoucherCheckLatestRun): string {
|
||||
if (row.status === 'queued') return t('workspace.voucherCheck.stepQueued');
|
||||
if (row.status === 'missing' && (row.current_step?.step === 'done' || !row.current_step)) {
|
||||
return t('workspace.voucherCheck.latestDoneHint');
|
||||
}
|
||||
if (row.status === 'completed' && (row.current_step?.step === 'done' || !row.current_step)) {
|
||||
return t('workspace.voucherCheck.latestCompleteHint');
|
||||
}
|
||||
if (row.status === 'technical_failed' && row.current_step?.step === 'fetch_erp') {
|
||||
return t('workspace.voucherCheck.stepFetchErpIncomplete');
|
||||
}
|
||||
return voucherCheckStepLabel(t, row.current_step?.step);
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片步骤辅文案:失败原因、排队等待或扫描进度。
|
||||
* @param row - 最近一次检核
|
||||
*/
|
||||
function latestHintText(row: VoucherCheckLatestRun): string {
|
||||
if (row.error_message) return row.error_message;
|
||||
if (row.status === 'queued') return t('workspace.voucherCheck.stepQueuedHint');
|
||||
if (row.status === 'running' && row.current_step?.step === 'scan_dms' && row.subject_count > 0) {
|
||||
return t('workspace.voucherCheck.processedHint', {
|
||||
processed: row.processed_count,
|
||||
total: row.subject_count,
|
||||
});
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开强制重检确认框;用公共 DeleteConfirmDialog 替代原生 window.confirm。
|
||||
*/
|
||||
@@ -264,13 +388,8 @@ async function forceRecheck() {
|
||||
try {
|
||||
const data = await triggerVoucherCheckForceAll();
|
||||
msg.success(t('workspace.voucherCheck.forceQueued', { runNo: data.run_no }));
|
||||
await loadRuns();
|
||||
stopForcePoll();
|
||||
const started = Date.now();
|
||||
forcePollTimer = setInterval(() => {
|
||||
void loadRuns();
|
||||
if (Date.now() - started > 120_000) stopForcePoll();
|
||||
}, 5000);
|
||||
await loadLatestRun({ silent: true });
|
||||
syncLatestPoll();
|
||||
} catch (e: any) {
|
||||
msg.error(e?.message || t('workspace.voucherCheck.forceFailed'));
|
||||
} finally {
|
||||
@@ -278,16 +397,40 @@ async function forceRecheck() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从最近一次检核卡片打开本批明细。
|
||||
*/
|
||||
function openLatestDetail() {
|
||||
const row = latestRun.value;
|
||||
if (!row?.schedule_run_id) {
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅在检核任务 Tab 且最近一批仍在排队/执行时轮询卡片。
|
||||
*/
|
||||
watch([listTab, latestInProgress], () => {
|
||||
syncLatestPoll();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (redirectLegacyRunQuery()) return;
|
||||
period.value = previousPeriod();
|
||||
const previous = previousYearMonth();
|
||||
periodYear.value = previous.year;
|
||||
periodMonth.value = previous.month;
|
||||
const qStatus = route.query.status;
|
||||
if (typeof qStatus === 'string' && qStatus) status.value = qStatus;
|
||||
await loadRuns();
|
||||
await Promise.all([loadRuns(), loadLatestRun()]);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
stopForcePoll();
|
||||
stopLatestPoll();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -321,22 +464,143 @@ onUnmounted(() => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<article
|
||||
v-if="listTab === 'tasks'"
|
||||
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>
|
||||
<h2 class="text-[15px] font-semibold text-primary">{{ $t('workspace.voucherCheck.latestTitle') }}</h2>
|
||||
<p v-if="latestRun" class="mt-1 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">
|
||||
<span
|
||||
v-if="latestRun"
|
||||
class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold"
|
||||
:class="latestBadgeClass(latestRun.status)"
|
||||
>
|
||||
{{ voucherCheckStatusLabel(t, latestRun.status) }}
|
||||
</span>
|
||||
<button
|
||||
v-if="isAdmin"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-xl border border-amber-300 bg-amber-50 px-3 py-1.5 text-sm font-medium text-amber-900 transition-colors hover:bg-amber-100 disabled:opacity-50"
|
||||
:disabled="forcing || latestInProgress"
|
||||
@click="openForceRecheck()"
|
||||
>
|
||||
<Loader2 v-if="forcing" class="h-3.5 w-3.5 animate-spin" />
|
||||
<RotateCcw v-else class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.voucherCheck.forceRecheck') }}
|
||||
</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
|
||||
class="h-full rounded-full transition-[width] duration-300"
|
||||
:class="latestRun.status === 'technical_failed' ? 'bg-rose-600' : 'bg-teal-700'"
|
||||
: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">
|
||||
<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) }}
|
||||
</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">
|
||||
{{ 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>
|
||||
</article>
|
||||
|
||||
<section class="flex flex-wrap items-end gap-3 rounded-2xl border border-default/80 bg-surface/70 px-4 py-3 shadow-sm">
|
||||
<label class="flex flex-col gap-1 text-xs font-medium text-muted">
|
||||
{{ $t('workspace.voucherCheck.period') }}
|
||||
<input v-model="period" type="month" class="rounded-xl border border-default bg-surface px-3 py-1.5 text-sm text-primary" />
|
||||
<span class="flex items-center gap-2">
|
||||
<span class="period-select">
|
||||
<select v-model="periodYear" class="period-select__control w-[4.75rem]">
|
||||
<option v-for="year in yearOptions" :key="year" :value="year">{{ year }}</option>
|
||||
</select>
|
||||
<ChevronDown class="period-select__icon" aria-hidden="true" />
|
||||
</span>
|
||||
<span class="period-select">
|
||||
<select v-model="periodMonth" class="period-select__control w-[4.75rem]">
|
||||
<option value="">{{ $t('workspace.voucherCheck.periodMonthAll') }}</option>
|
||||
<option v-for="month in MONTH_VALUES" :key="month" :value="month">
|
||||
{{ $t('workspace.voucherCheck.periodMonthValue', { n: Number(month) }) }}
|
||||
</option>
|
||||
</select>
|
||||
<ChevronDown class="period-select__icon" aria-hidden="true" />
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
<label v-if="listTab === 'tasks'" class="flex flex-col gap-1 text-xs font-medium text-muted">
|
||||
{{ $t('workspace.voucherCheck.status') }}
|
||||
<select v-model="status" class="rounded-xl border border-default bg-surface px-3 py-1.5 text-sm text-primary">
|
||||
<option v-for="opt in statusOptions" :key="opt.value || 'all'" :value="opt.value">{{ opt.label }}</option>
|
||||
</select>
|
||||
<span class="period-select">
|
||||
<select v-model="status" class="period-select__control w-[6rem]">
|
||||
<option v-for="opt in statusOptions" :key="opt.value || 'all'" :value="opt.value">{{ opt.label }}</option>
|
||||
</select>
|
||||
<ChevronDown class="period-select__icon" aria-hidden="true" />
|
||||
</span>
|
||||
</label>
|
||||
<label v-else class="flex flex-col gap-1 text-xs font-medium text-muted">
|
||||
{{ $t('workspace.voucherCheck.notifyStatus') }}
|
||||
<select v-model="notifyStatus" class="rounded-xl border border-default bg-surface px-3 py-1.5 text-sm text-primary">
|
||||
<option v-for="opt in notifyStatusOptions" :key="opt.value || 'all'" :value="opt.value">{{ opt.label }}</option>
|
||||
</select>
|
||||
<span class="period-select">
|
||||
<select v-model="notifyStatus" class="period-select__control w-[7.25rem]">
|
||||
<option v-for="opt in notifyStatusOptions" :key="opt.value || 'all'" :value="opt.value">{{ opt.label }}</option>
|
||||
</select>
|
||||
<ChevronDown class="period-select__icon" aria-hidden="true" />
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
@@ -346,25 +610,6 @@ onUnmounted(() => {
|
||||
<Search class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.voucherCheck.search') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-xl border border-default px-3 py-1.5 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
@click="refreshCurrentTab"
|
||||
>
|
||||
<RefreshCw class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.voucherCheck.refresh') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="listTab === 'tasks'"
|
||||
type="button"
|
||||
class="ml-auto inline-flex items-center gap-1 rounded-xl border border-amber-300 bg-amber-50 px-3 py-1.5 text-sm font-medium text-amber-900 transition-colors hover:bg-amber-100 disabled:opacity-50"
|
||||
:disabled="forcing"
|
||||
@click="openForceRecheck()"
|
||||
>
|
||||
<Loader2 v-if="forcing" class="h-3.5 w-3.5 animate-spin" />
|
||||
<RotateCcw v-else class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.voucherCheck.forceRecheck') }}
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section v-if="listTab === 'tasks'" class="overflow-hidden rounded-2xl border border-default bg-surface">
|
||||
@@ -524,3 +769,51 @@ onUnmounted(() => {
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/**
|
||||
* 隐藏系统原生下拉箭头(含 Chromium ::picker-icon / Edge ::-ms-expand)。
|
||||
* 只保留模板里的 ChevronDown,避免 Windows 下年份与月份箭头叠在一起。
|
||||
*/
|
||||
.period-select {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.period-select__control {
|
||||
box-sizing: border-box;
|
||||
border-radius: 0.75rem;
|
||||
border: 1px solid var(--border-default);
|
||||
background-color: var(--bg-surface);
|
||||
background-image: none;
|
||||
padding: 0.375rem 1.75rem 0.375rem 0.625rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--text-primary);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.period-select__control::-ms-expand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.period-select__control::picker-icon {
|
||||
display: none;
|
||||
content: none;
|
||||
}
|
||||
|
||||
.period-select__icon {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
height: 0.875rem;
|
||||
width: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
@@ -2365,6 +2365,8 @@
|
||||
"difySystemPromptPlaceholder": "e.g. You are a material compliance assistant. Based on record test data, return JSON with dify_result (pass/fail/manual review) and dify_message.",
|
||||
"platformJobAccountingVoucherCheck": "Accounting voucher check",
|
||||
"accountingVoucherCheckHint": "Every Tuesday, check the previous calendar month of sales invoice attachments: load the ERP invoice list, scan document-library type folders, and archive by invoice (skip same names).",
|
||||
"platformJobAccountingVoucherPoPrint": "Accounting voucher PO print",
|
||||
"accountingVoucherPoPrintHint": "Every Tuesday at 05:00, fetch last month's invoices from ERP, generate purchase-order PDFs, and upload them to the PO-order folder—before the 06:00 check. Skip same names.",
|
||||
"voucherCheckScope": "Ledger scope",
|
||||
"voucherCheckProfile": "Business profile",
|
||||
"voucherCheckNotifyMissing": "Notify on missing materials",
|
||||
@@ -4792,7 +4794,7 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "Contract Payment Alerts", "subtitle": "Sync OA contract, acceptance, and vendor prepayment requests; notify procurement roles through three escalation rounds.", "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", "needsCompletion": "Needs completion", "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", "archiveDate": "Contract archive date", "archiveDateHint": "This date is when the contract apLine 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, 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
|
||||
},
|
||||
"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"},
|
||||
"contractPaymentReparse": {"action": "Reparse contract original", "success": "Reparsed with attachment “{attachment}”", "failed": "Failed to reparse contract"},
|
||||
|
||||
@@ -1062,7 +1062,11 @@
|
||||
"count": "{count} people",
|
||||
"empty": "No personnel data",
|
||||
"passRate": "Completion Rate",
|
||||
"periodLabel": "Period {index}"
|
||||
"periodLabel": "Session {index}",
|
||||
"export": "Export Excel",
|
||||
"exporting": "Exporting...",
|
||||
"exportSuccess": "Excel exported successfully",
|
||||
"exportFailed": "Excel export failed. Please try again later."
|
||||
},
|
||||
"columns": {
|
||||
"employeeId": "Employee ID",
|
||||
|
||||
@@ -528,6 +528,8 @@
|
||||
"VOUCHER_CHECK_RUN_IN_PROGRESS": "An accounting voucher check is already queued or running. Try again later.",
|
||||
"VOUCHER_CHECK_SCHEDULE_NOT_FOUND": "The accounting voucher check schedule was not found.",
|
||||
"VOUCHER_CHECK_PERSIST_FAILED": "Failed to persist voucher check results.",
|
||||
"VOUCHER_CHECK_PO_PDF_INVALID": "Purchase-order PDF data is invalid. Provide a valid invoice number and order number.",
|
||||
"VOUCHER_CHECK_PO_UPLOAD_FAILED": "Failed to upload the purchase-order PDF to the DMS PO-order folder.",
|
||||
"TRANSFER_PERMISSION_DENIED": "No in-transit transfer permission.",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "Same-day receipt is not matured yet.",
|
||||
"TRANSFER_FILE_NOT_READY": "Receipt file is not ready.",
|
||||
|
||||
@@ -784,6 +784,8 @@
|
||||
"title": "Accounting voucher check tasks",
|
||||
"subtitle": "Every Tuesday the job incrementally checks the previous calendar month, scans sales invoice attachment folders, archives by invoice, and summarizes missing files.",
|
||||
"period": "Document period",
|
||||
"periodMonthAll": "All",
|
||||
"periodMonthValue": "Month {n}",
|
||||
"status": "Status",
|
||||
"statusAll": "All",
|
||||
"statusComplete": "Complete",
|
||||
@@ -791,6 +793,8 @@
|
||||
"statusSkipped": "Skipped",
|
||||
"statusTechError": "Technical failure",
|
||||
"statusPending": "Pending",
|
||||
"statusQueued": "Queued",
|
||||
"statusRunning": "Running",
|
||||
"invoiceNo": "invoice",
|
||||
"invoiceDate": "Invoice date",
|
||||
"invoicePlaceholder": "Filter by invoice",
|
||||
@@ -800,7 +804,6 @@
|
||||
"checkedAt": "Run time",
|
||||
"result": "Result",
|
||||
"search": "Search",
|
||||
"refresh": "Refresh",
|
||||
"loading": "Loading…",
|
||||
"empty": "No check batches yet",
|
||||
"loadFailed": "Failed to load voucher check tasks",
|
||||
@@ -826,9 +829,34 @@
|
||||
"viewDetail": "View details",
|
||||
"forceRecheck": "Force recheck last month",
|
||||
"failureReason": "Failure reason",
|
||||
"forceConfirm": "This will fully recheck the previous calendar month. Already archived files will not be skipped, and the period filter above is ignored. Continue?",
|
||||
"forceQueued": "Force recheck queued ({runNo}). The list will refresh when it finishes.",
|
||||
"forceConfirm": "This will fully recheck the previous calendar month. Already archived files will not be skipped, and the period filter below is ignored. Continue?",
|
||||
"forceQueued": "Force recheck queued ({runNo}). Progress will update on this card.",
|
||||
"forceFailed": "Failed to queue the force recheck",
|
||||
"latestTitle": "Latest check",
|
||||
"latestEmpty": "No check batches yet",
|
||||
"latestLoadFailed": "Failed to load the latest check",
|
||||
"latestBatch": "Batch {runNo}",
|
||||
"latestPeriod": "Period {period}",
|
||||
"modeIncremental": "Incremental",
|
||||
"modeForceAll": "Full recheck",
|
||||
"modeSingle": "Single invoice",
|
||||
"progress": "Progress {percent}%",
|
||||
"startedAt": "Started",
|
||||
"finishedAt": "Finished",
|
||||
"inProgress": "In progress",
|
||||
"viewLatestDetail": "View this batch",
|
||||
"archivedFiles": "Archived files",
|
||||
"processedHint": "Processed {processed} / {total} invoices",
|
||||
"latestDoneHint": "This batch is complete. Missing-file results have been written to Excel.",
|
||||
"latestCompleteHint": "This batch is complete.",
|
||||
"stepQueued": "Force recheck of last month is queued",
|
||||
"stepQueuedHint": "Waiting for the schedule worker to pick it up",
|
||||
"stepFetchErp": "Fetching last month’s sales invoices",
|
||||
"stepFetchErpIncomplete": "Fetching last month’s sales invoices did not finish",
|
||||
"stepScanDms": "Scanning sales invoice attachment type folders",
|
||||
"stepPersist": "Writing check records",
|
||||
"stepNotify": "Sending the WeCom summary",
|
||||
"stepDone": "Check complete",
|
||||
"tabTasks": "Check tasks",
|
||||
"tabNotifications": "WeCom send log",
|
||||
"notifyEmpty": "No WeCom send records yet",
|
||||
|
||||
@@ -2243,6 +2243,8 @@
|
||||
"difySystemPromptPlaceholder": "เช่น คุณเป็นผู้ช่วยตรวจสอบความสอดคล้องของวัสดุ จากข้อมูล record ให้คืน JSON: dify_result (ผ่าน/ไม่ผ่าน/ตรวจด้วยมือ) และ dify_message",
|
||||
"platformJobAccountingVoucherCheck": "ตรวจสอบเอกสารบัญชี",
|
||||
"accountingVoucherCheckHint": "ทุกวันอังคาร ตรวจเอกสารใบแจ้งหนี้ขายของเดือนก่อน: ดึงรายการใบแจ้งหนี้จาก ERP สแกนโฟลเดอร์ประเภทในคลังเอกสาร แล้วจัดเก็บตาม invoice (ข้ามชื่อซ้ำ)",
|
||||
"platformJobAccountingVoucherPoPrint": "สร้างใบสั่งซื้อ PO สำหรับเอกสารบัญชี",
|
||||
"accountingVoucherPoPrintHint": "ทุกวันอังคาร 05:00 ดึงใบแจ้งหนี้เดือนก่อนจาก ERP สร้าง PDF ใบสั่งซื้อมาตรฐาน แล้วอัปโหลดไปยังโฟลเดอร์ PO — ก่อนงานตรวจ 06:00 ข้ามชื่อซ้ำ",
|
||||
"voucherCheckScope": "ชุดบัญชี",
|
||||
"voucherCheckProfile": "โปรไฟล์ฝ่ายธุรกิจ",
|
||||
"voucherCheckNotifyMissing": "แจ้งเตือนเมื่อขาดเอกสาร",
|
||||
@@ -4661,7 +4663,7 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "แจ้งเตือนการชำระเงินตามสัญญา", "subtitle": "ซิงก์สัญญา OA การรับมอบ และคำขอเบิกเงินล่วงหน้าของผู้ขาย พร้อมแจ้งเตือน 3 ระดับ", "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": "ค้างชำระเกินกำหนด", "needsCompletion": "รอข้อมูลเพิ่ม", "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": "กำลังดำเนินการ", "statusLine 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": "ไม่มีสัญญาที่รอยืนยัน"},
|
||||
"contractPaymentReparse": {"action": "แยกข้อมูลจากต้นฉบับอีกครั้ง", "success": "แยกข้อมูลใหม่ด้วยไฟล์แนบ “{attachment}” แล้ว", "failed": "แยกข้อมูลสัญญาใหม่ไม่สำเร็จ"},
|
||||
|
||||
@@ -1062,7 +1062,11 @@
|
||||
"count": "{count} คน",
|
||||
"empty": "ไม่มีข้อมูลบุคลากร",
|
||||
"passRate": "อัตราความสำเร็จ",
|
||||
"periodLabel": "รอบที่ {index}"
|
||||
"periodLabel": "รอบที่ {index}",
|
||||
"export": "ส่งออก Excel",
|
||||
"exporting": "กำลังส่งออก...",
|
||||
"exportSuccess": "ส่งออก Excel สำเร็จ",
|
||||
"exportFailed": "ส่งออก Excel ไม่สำเร็จ โปรดลองอีกครั้งภายหลัง"
|
||||
},
|
||||
"columns": {
|
||||
"employeeId": "รหัสพนักงาน",
|
||||
|
||||
@@ -528,6 +528,8 @@
|
||||
"VOUCHER_CHECK_RUN_IN_PROGRESS": "งานตรวจเอกสารบัญชียังอยู่ในคิวหรือกำลังทำงาน โปรดลองใหม่ภายหลัง",
|
||||
"VOUCHER_CHECK_SCHEDULE_NOT_FOUND": "ไม่พบตารางงานตรวจเอกสารบัญชี",
|
||||
"VOUCHER_CHECK_PERSIST_FAILED": "บันทึกผลการตรวจไม่สำเร็จ",
|
||||
"VOUCHER_CHECK_PO_PDF_INVALID": "ข้อมูล PDF ใบสั่งซื้อไม่ถูกต้อง กรุณาระบุเลขที่ใบแจ้งหนี้และเลขที่ใบสั่งที่ถูกต้อง",
|
||||
"VOUCHER_CHECK_PO_UPLOAD_FAILED": "อัปโหลดไฟล์ PDF ใบสั่งซื้อไปยังโฟลเดอร์ PO订单 ในคลังเอกสารไม่สำเร็จ",
|
||||
"TRANSFER_PERMISSION_DENIED": "ไม่มีสิทธิ์โอนระหว่างคลัง",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "การรับของวันนี้ยังไม่พร้อมดำเนินการ",
|
||||
"TRANSFER_FILE_NOT_READY": "ไฟล์รับของยังไม่พร้อม",
|
||||
|
||||
@@ -720,6 +720,8 @@
|
||||
"title": "งานตรวจเอกสารบัญชี",
|
||||
"subtitle": "ทุกวันอังคารตรวจเดือนปฏิทินก่อนหน้าแบบเพิ่มส่วน แสกนโฟลเดอร์เอกสารขาย แล้วจัดเก็บตาม invoice พร้อมสรุปไฟล์ที่ขาด",
|
||||
"period": "ช่วงเอกสาร",
|
||||
"periodMonthAll": "ทั้งหมด",
|
||||
"periodMonthValue": "เดือน {n}",
|
||||
"status": "สถานะ",
|
||||
"statusAll": "ทั้งหมด",
|
||||
"statusComplete": "ครบ",
|
||||
@@ -727,6 +729,8 @@
|
||||
"statusSkipped": "ข้าม",
|
||||
"statusTechError": "ล้มเหลวทางเทคนิค",
|
||||
"statusPending": "รอดำเนินการ",
|
||||
"statusQueued": "อยู่ในคิว",
|
||||
"statusRunning": "กำลังทำงาน",
|
||||
"invoiceNo": "invoice",
|
||||
"invoiceDate": "วันที่ใบแจ้งหนี้",
|
||||
"invoicePlaceholder": "กรองด้วย invoice",
|
||||
@@ -736,7 +740,6 @@
|
||||
"checkedAt": "เวลาที่รัน",
|
||||
"result": "ผลลัพธ์",
|
||||
"search": "ค้นหา",
|
||||
"refresh": "รีเฟรช",
|
||||
"loading": "กำลังโหลด…",
|
||||
"empty": "ยังไม่มีรอบการตรวจ",
|
||||
"loadFailed": "โหลดงานตรวจไม่สำเร็จ",
|
||||
@@ -762,9 +765,34 @@
|
||||
"viewDetail": "ดูรายละเอียด",
|
||||
"forceRecheck": "ตรวจเดือนที่แล้วใหม่ทั้งชุด",
|
||||
"failureReason": "สาเหตุที่ล้มเหลว",
|
||||
"forceConfirm": "ระบบจะตรวจเดือนปฏิทินก่อนหน้าทั้งชุด ไม่ข้ามไฟล์ที่จัดเก็บแล้ว และไม่ใช้ช่วงที่กรองด้านบน ต้องการเริ่มหรือไม่?",
|
||||
"forceQueued": "จัดคิวตรวจใหม่แล้ว ({runNo}) รายการจะรีเฟรชเมื่อเสร็จ",
|
||||
"forceConfirm": "ระบบจะตรวจเดือนปฏิทินก่อนหน้าทั้งชุด ไม่ข้ามไฟล์ที่จัดเก็บแล้ว และไม่ใช้ช่วงที่กรองด้านล่าง ต้องการเริ่มหรือไม่?",
|
||||
"forceQueued": "จัดคิวตรวจใหม่แล้ว ({runNo}) ความคืบหน้าจะอัปเดตบนการ์ดนี้",
|
||||
"forceFailed": "จัดคิวตรวจใหม่ไม่สำเร็จ",
|
||||
"latestTitle": "การตรวจล่าสุด",
|
||||
"latestEmpty": "ยังไม่มีรอบการตรวจ",
|
||||
"latestLoadFailed": "โหลดการตรวจล่าสุดไม่สำเร็จ",
|
||||
"latestBatch": "รอบ {runNo}",
|
||||
"latestPeriod": "ช่วง {period}",
|
||||
"modeIncremental": "แบบเพิ่มทีละส่วน",
|
||||
"modeForceAll": "ตรวจใหม่ทั้งชุด",
|
||||
"modeSingle": "ใบเดียว",
|
||||
"progress": "ความคืบหน้า {percent}%",
|
||||
"startedAt": "เริ่ม",
|
||||
"finishedAt": "เสร็จ",
|
||||
"inProgress": "กำลังดำเนินการ",
|
||||
"viewLatestDetail": "ดูรายละเอียดรอบนี้",
|
||||
"archivedFiles": "ไฟล์ที่จัดเก็บแล้ว",
|
||||
"processedHint": "ประมวลผลแล้ว {processed} / {total} ใบ invoice",
|
||||
"latestDoneHint": "รอบนี้เสร็จแล้ว ผลไฟล์ที่ขาดถูกเขียนลง Excel",
|
||||
"latestCompleteHint": "รอบนี้เสร็จแล้ว",
|
||||
"stepQueued": "จัดคิวตรวจเดือนที่แล้วใหม่ทั้งชุดแล้ว",
|
||||
"stepQueuedHint": "รอให้ schedule worker รับงาน",
|
||||
"stepFetchErp": "กำลังดึง invoice ขายของเดือนที่แล้ว",
|
||||
"stepFetchErpIncomplete": "ดึง invoice ขายของเดือนที่แล้วยังไม่เสร็จ",
|
||||
"stepScanDms": "กำลังสแกนโฟลเดอร์ประเภทเอกสารใบแจ้งหนี้ขาย",
|
||||
"stepPersist": "กำลังบันทึกผลตรวจ",
|
||||
"stepNotify": "กำลังส่งสรุป WeCom",
|
||||
"stepDone": "ตรวจเสร็จแล้ว",
|
||||
"tabTasks": "งานตรวจ",
|
||||
"tabNotifications": "ประวัติส่ง WeCom",
|
||||
"notifyEmpty": "ยังไม่มีประวัติส่ง WeCom",
|
||||
|
||||
@@ -2477,6 +2477,8 @@
|
||||
"difySystemPromptPlaceholder": "例如:你是物料合规判定助手。根据 record 中的检测数据判定是否合格,仅返回 JSON:dify_result(合格/不合格/人工判定)与 dify_message。",
|
||||
"platformJobAccountingVoucherCheck": "立账凭证检核",
|
||||
"accountingVoucherCheckHint": "每周二检核上一个自然月的销售开票附件:拉取 ERP 发票清单,扫描文档库类型目录并按 invoice 归档(同名跳过)。",
|
||||
"platformJobAccountingVoucherPoPrint": "立账凭证 PO 订单生成",
|
||||
"accountingVoucherPoPrintHint": "每周二 05:00 按上月发票从 ERP 取数,生成制式采购单 PDF 并上传到「PO订单」目录;早于 06:00 检核周批。同名跳过。",
|
||||
"voucherCheckScope": "账套",
|
||||
"voucherCheckProfile": "业务方 Profile",
|
||||
"voucherCheckNotifyMissing": "缺资料通知",
|
||||
@@ -4779,6 +4781,7 @@
|
||||
"contractPayment": {
|
||||
"title": "合同付款预警",
|
||||
"subtitle": "同步 OA 合同、验收和厂商预付款请款作业,按三轮规则通知采购岗位",
|
||||
"sessionHint": "本期不使用对话和历史会话,请从上方 Tab 查看台账。",
|
||||
"sync": "同步 OA 数据",
|
||||
"forceSync": "强制覆盖 OA 字段",
|
||||
"forceSyncConfirm": "将用本次 OA 返回的非空字段覆盖已有 OA 数据,并记录变更审计。是否继续?",
|
||||
@@ -4801,7 +4804,7 @@
|
||||
"timeline": "付款计划时间线",
|
||||
"notAvailable": "—",
|
||||
"stats": {"contracts": "合同总数", "pendingParse": "待处理合同", "readyPlans": "计划已生成", "alerts": "待预警节点"},
|
||||
"ledgerFocus": {"due": "即将到期", "dueHint": "7日内", "overdue": "逾期未付", "needsCompletion": "待补充", "dueThisMonth": "本月应付", "dueThisMonthHint": "本自然月"},
|
||||
"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": "已确定",
|
||||
|
||||
@@ -1096,7 +1096,11 @@
|
||||
"count": "共 {count} 人",
|
||||
"empty": "暂无人员数据",
|
||||
"passRate": "完成率",
|
||||
"periodLabel": "第 {index} 期"
|
||||
"periodLabel": "第 {index} 期",
|
||||
"export": "导出 Excel",
|
||||
"exporting": "正在导出...",
|
||||
"exportSuccess": "Excel 导出成功",
|
||||
"exportFailed": "Excel 导出失败,请稍后重试"
|
||||
},
|
||||
"columns": {
|
||||
"employeeId": "工号",
|
||||
|
||||
@@ -528,6 +528,8 @@
|
||||
"VOUCHER_CHECK_RUN_IN_PROGRESS": "立账凭证检核正在执行或排队中,请稍后再试。",
|
||||
"VOUCHER_CHECK_SCHEDULE_NOT_FOUND": "未找到立账凭证检核排程任务。",
|
||||
"VOUCHER_CHECK_PERSIST_FAILED": "检核结果落库失败。",
|
||||
"VOUCHER_CHECK_PO_PDF_INVALID": "采购单 PDF 数据无效:请提供合法的发票号和订单号。",
|
||||
"VOUCHER_CHECK_PO_UPLOAD_FAILED": "采购单 PDF 上传到文档库「PO订单」目录失败。",
|
||||
"TRANSFER_PERMISSION_DENIED": "无在途调拨权限。",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "当天收料尚未成熟,不可查询或调拨。",
|
||||
"TRANSFER_FILE_NOT_READY": "收料文件尚未就绪。",
|
||||
|
||||
@@ -784,6 +784,8 @@
|
||||
"title": "立账凭证检核任务",
|
||||
"subtitle": "每周二增量检核上一个自然月;扫描销售开票附件类型目录后按 invoice 归档,并汇总缺件。",
|
||||
"period": "资料所属期间",
|
||||
"periodMonthAll": "全部",
|
||||
"periodMonthValue": "{n}月",
|
||||
"status": "状态",
|
||||
"statusAll": "全部",
|
||||
"statusComplete": "完整",
|
||||
@@ -791,6 +793,8 @@
|
||||
"statusSkipped": "跳过",
|
||||
"statusTechError": "技术失败",
|
||||
"statusPending": "待处理",
|
||||
"statusQueued": "排队中",
|
||||
"statusRunning": "执行中",
|
||||
"invoiceNo": "invoice",
|
||||
"invoiceDate": "发票日期",
|
||||
"invoicePlaceholder": "输入 invoice 筛选",
|
||||
@@ -800,7 +804,6 @@
|
||||
"checkedAt": "执行时间",
|
||||
"result": "结论",
|
||||
"search": "查询",
|
||||
"refresh": "刷新",
|
||||
"loading": "加载中…",
|
||||
"empty": "暂无检核批次",
|
||||
"loadFailed": "加载检核任务失败",
|
||||
@@ -826,9 +829,34 @@
|
||||
"viewDetail": "查看详情",
|
||||
"forceRecheck": "强制重检上月",
|
||||
"failureReason": "失败原因",
|
||||
"forceConfirm": "将全量重检上一个自然月,不跳过已归档记录,也不使用上方筛选的期间。确定开始?",
|
||||
"forceQueued": "已入队强制重检({runNo}),完成后列表会自动刷新。",
|
||||
"forceConfirm": "将全量重检上一个自然月,不跳过已归档记录,也不使用下方筛选的期间。确定开始?",
|
||||
"forceQueued": "已入队强制重检({runNo}),进度将在本卡更新。",
|
||||
"forceFailed": "强制重检入队失败",
|
||||
"latestTitle": "最近一次检核",
|
||||
"latestEmpty": "暂无检核批次",
|
||||
"latestLoadFailed": "加载最近一次检核失败",
|
||||
"latestBatch": "批次 {runNo}",
|
||||
"latestPeriod": "期间 {period}",
|
||||
"modeIncremental": "增量",
|
||||
"modeForceAll": "全量重检",
|
||||
"modeSingle": "单票",
|
||||
"progress": "进度 {percent}%",
|
||||
"startedAt": "开始",
|
||||
"finishedAt": "完成",
|
||||
"inProgress": "进行中",
|
||||
"viewLatestDetail": "查看本批详情",
|
||||
"archivedFiles": "已归档文件",
|
||||
"processedHint": "已处理 {processed} / {total} 张 invoice",
|
||||
"latestDoneHint": "本批已完成,缺件结果已写入 Excel。",
|
||||
"latestCompleteHint": "本批已完成。",
|
||||
"stepQueued": "已入队强制重检上月",
|
||||
"stepQueuedHint": "等待 schedule worker 领取",
|
||||
"stepFetchErp": "拉取上月销售 invoice",
|
||||
"stepFetchErpIncomplete": "拉取上月销售 invoice 未完成",
|
||||
"stepScanDms": "扫描销售开票附件类型目录",
|
||||
"stepPersist": "写入检核记录",
|
||||
"stepNotify": "发送企微汇总",
|
||||
"stepDone": "检核完成",
|
||||
"tabTasks": "检核任务",
|
||||
"tabNotifications": "企微发送记录",
|
||||
"notifyEmpty": "暂无企业微信发送记录",
|
||||
|
||||
@@ -2248,6 +2248,8 @@
|
||||
"difySystemPromptPlaceholder": "例如:你是物料合規判定助手。根據 record 中的檢測資料判定是否合格,僅返回 JSON:dify_result(合格/不合格/人工判定)與 dify_message。",
|
||||
"platformJobAccountingVoucherCheck": "立帳憑證檢核",
|
||||
"accountingVoucherCheckHint": "每週二檢核上一個自然月的銷售開票附件:拉取 ERP 發票清單,掃描文件庫類型目錄並依 invoice 歸檔(同名略過)。",
|
||||
"platformJobAccountingVoucherPoPrint": "立帳憑證 PO 訂單產生",
|
||||
"accountingVoucherPoPrintHint": "每週二 05:00 依上月發票從 ERP 取數,產生制式採購單 PDF 並上傳到「PO訂單」目錄;早於 06:00 檢核週批。同名略過。",
|
||||
"voucherCheckScope": "帳套",
|
||||
"voucherCheckProfile": "業務方 Profile",
|
||||
"voucherCheckNotifyMissing": "缺資料通知",
|
||||
@@ -4666,7 +4668,7 @@
|
||||
}
|
||||
},
|
||||
"contractPayment": {
|
||||
"title": "合約付款預警", "subtitle": "同步 OA 合約、驗收和廠商預付款請款作業,按三輪規則通知採購職位", "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": "逾期未付", "needsCompletion": "待補充", "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": "計畫狀態", "attachmentsEmpty": "暫無已歸檔的合約原文附件", "downloadAttachment": "下載Line 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": "計畫狀態", "attachmLine truncated
|
||||
},
|
||||
"contractPaymentReview": {"title": "待確認合約", "subtitle": "未符合設備採購合約同義標題組、付款比例驗證失敗或關鍵欄位衝突的合約,不會進入付款預警,請下載原文核對。", "searchPlaceholder": "合約編號、採購單號或供應商", "loadFailed": "待確認合約載入失敗", "contractWorkflow": "合約號 / 流程編號", "reason": "待確認原因", "fallbackIssue": "解析結果待人工確認", "empty": "暫無待確認合約"},
|
||||
"contractPaymentReparse": {"action": "重新解析合約原文", "success": "已使用附件“{attachment}”重新解析", "failed": "重新解析合約失敗"},
|
||||
|
||||
@@ -1062,7 +1062,11 @@
|
||||
"count": "共 {count} 人",
|
||||
"empty": "暫無人員資料",
|
||||
"passRate": "完成率",
|
||||
"periodLabel": "第 {index} 期"
|
||||
"periodLabel": "第 {index} 期",
|
||||
"export": "匯出 Excel",
|
||||
"exporting": "正在匯出...",
|
||||
"exportSuccess": "Excel 匯出成功",
|
||||
"exportFailed": "Excel 匯出失敗,請稍後再試"
|
||||
},
|
||||
"columns": {
|
||||
"employeeId": "工號",
|
||||
|
||||
@@ -528,6 +528,8 @@
|
||||
"VOUCHER_CHECK_RUN_IN_PROGRESS": "立帳憑證檢核正在執行或排隊中,請稍後再試。",
|
||||
"VOUCHER_CHECK_SCHEDULE_NOT_FOUND": "找不到立帳憑證檢核排程任務。",
|
||||
"VOUCHER_CHECK_PERSIST_FAILED": "檢核結果寫入失敗。",
|
||||
"VOUCHER_CHECK_PO_PDF_INVALID": "採購單 PDF 資料無效:請提供合法的發票號和訂單號。",
|
||||
"VOUCHER_CHECK_PO_UPLOAD_FAILED": "採購單 PDF 上傳到文件庫「PO訂單」目錄失敗。",
|
||||
"TRANSFER_PERMISSION_DENIED": "無在途調撥權限。",
|
||||
"TRANSFER_RECEIPT_NOT_MATURED": "當天收料尚未成熟,不可查詢或調撥。",
|
||||
"TRANSFER_FILE_NOT_READY": "收料檔案尚未就緒。",
|
||||
|
||||
@@ -784,6 +784,8 @@
|
||||
"title": "立帳憑證檢核任務",
|
||||
"subtitle": "每週二增量檢核上一個自然月;掃描銷售開票附件類型目錄後按 invoice 歸檔,並彙總缺件。",
|
||||
"period": "資料所屬期間",
|
||||
"periodMonthAll": "全部",
|
||||
"periodMonthValue": "{n}月",
|
||||
"status": "狀態",
|
||||
"statusAll": "全部",
|
||||
"statusComplete": "完整",
|
||||
@@ -791,6 +793,8 @@
|
||||
"statusSkipped": "跳過",
|
||||
"statusTechError": "技術失敗",
|
||||
"statusPending": "待處理",
|
||||
"statusQueued": "排隊中",
|
||||
"statusRunning": "執行中",
|
||||
"invoiceNo": "invoice",
|
||||
"invoiceDate": "發票日期",
|
||||
"invoicePlaceholder": "輸入 invoice 篩選",
|
||||
@@ -800,7 +804,6 @@
|
||||
"checkedAt": "執行時間",
|
||||
"result": "結論",
|
||||
"search": "查詢",
|
||||
"refresh": "重新整理",
|
||||
"loading": "載入中…",
|
||||
"empty": "暫無檢核批次",
|
||||
"loadFailed": "載入檢核任務失敗",
|
||||
@@ -826,9 +829,34 @@
|
||||
"viewDetail": "查看詳情",
|
||||
"forceRecheck": "強制重檢上月",
|
||||
"failureReason": "失敗原因",
|
||||
"forceConfirm": "將全量重檢上一個自然月,不跳過已歸檔紀錄,也不使用上方篩選的期間。確定開始?",
|
||||
"forceQueued": "已排入強制重檢({runNo}),完成後列表會自動重新整理。",
|
||||
"forceConfirm": "將全量重檢上一個自然月,不跳過已歸檔紀錄,也不使用下方篩選的期間。確定開始?",
|
||||
"forceQueued": "已排入強制重檢({runNo}),進度將在本卡更新。",
|
||||
"forceFailed": "強制重檢排入失敗",
|
||||
"latestTitle": "最近一次檢核",
|
||||
"latestEmpty": "暫無檢核批次",
|
||||
"latestLoadFailed": "載入最近一次檢核失敗",
|
||||
"latestBatch": "批次 {runNo}",
|
||||
"latestPeriod": "期間 {period}",
|
||||
"modeIncremental": "增量",
|
||||
"modeForceAll": "全量重檢",
|
||||
"modeSingle": "單票",
|
||||
"progress": "進度 {percent}%",
|
||||
"startedAt": "開始",
|
||||
"finishedAt": "完成",
|
||||
"inProgress": "進行中",
|
||||
"viewLatestDetail": "查看本批詳情",
|
||||
"archivedFiles": "已歸檔檔案",
|
||||
"processedHint": "已處理 {processed} / {total} 張 invoice",
|
||||
"latestDoneHint": "本批已完成,缺件結果已寫入 Excel。",
|
||||
"latestCompleteHint": "本批已完成。",
|
||||
"stepQueued": "已排入強制重檢上月",
|
||||
"stepQueuedHint": "等待 schedule worker 領取",
|
||||
"stepFetchErp": "拉取上月銷售 invoice",
|
||||
"stepFetchErpIncomplete": "拉取上月銷售 invoice 未完成",
|
||||
"stepScanDms": "掃描銷售開票附件類型目錄",
|
||||
"stepPersist": "寫入檢核紀錄",
|
||||
"stepNotify": "發送企微彙總",
|
||||
"stepDone": "檢核完成",
|
||||
"tabTasks": "檢核任務",
|
||||
"tabNotifications": "企微發送紀錄",
|
||||
"notifyEmpty": "暫無企業微信發送紀錄",
|
||||
|
||||
@@ -10,6 +10,7 @@ export const AGENT_CODE_GENERIC = 'generic';
|
||||
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_IN_TRANSIT_TRANSFER = 'in_transit_transfer';
|
||||
|
||||
export interface AgentRegistryCapabilities {
|
||||
@@ -237,6 +238,11 @@ export function isProcurementContractAgent(agent: AgentLike): boolean {
|
||||
return resolveAgentCode(agent) === AGENT_CODE_PROCUREMENT_CONTRACT_REVIEW;
|
||||
}
|
||||
|
||||
/** 是否为合同付款预警 Agent(agent_code=contract_payment)。 */
|
||||
export function isContractPaymentAgent(agent: AgentLike): boolean {
|
||||
return resolveAgentCode(agent) === AGENT_CODE_CONTRACT_PAYMENT;
|
||||
}
|
||||
|
||||
/** 是否启用本地请假表单(后端 leave_feature_enabled)。 */
|
||||
export function canUseLeaveFeature(agent: AgentLike): boolean {
|
||||
return Boolean(agent?.leave_feature_enabled);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
export type FeaturePermissions = {
|
||||
training_hr_manage?: boolean;
|
||||
'contract_payment.access'?: boolean;
|
||||
[key: string]: boolean | undefined;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user