From efc0c3a697969503634138d7881543f4099b81ca Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 13:32:09 +0800
Subject: [PATCH] 审批模板导入只能从已有模板导入
---
src/views/officeProcessAutomation/ApproveManage/approve-template/components/FormConfigEditor.vue | 108 ++++++
src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js | 3
src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/travelReimburseUtils.js | 15
src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js | 179 -----------
src/views/officeProcessAutomation/AttendManage/overtime-apply/index.vue | 41 --
src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js | 12
src/views/officeProcessAutomation/HrManage/work-handover/index.vue | 50 ---
src/views/officeProcessAutomation/HrManage/regular-apply/index.vue | 34 --
src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js | 2
src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/useTravelReimburse.js | 88 -----
src/views/officeProcessAutomation/AttendManage/leave-apply/index.vue | 56 ---
src/views/officeProcessAutomation/HrManage/transfer-apply/index.vue | 36 --
src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js | 104 ------
src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/costReimburseUtils.js | 37 +-
src/views/officeProcessAutomation/EnterpriseNews/news-manage/index.vue | 2
src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js | 10
src/views/officeProcessAutomation/EnterpriseNews/news-manage/useEnterpriseNews.js | 7
src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/noticeAnnouncementUtils.js | 63 ----
src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue | 2
19 files changed, 161 insertions(+), 688 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
index 090dbb1..acbed98 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/approveListConstants.js
@@ -35,16 +35,6 @@
{ value: "cancelled", label: "宸叉挙閿�" },
];
-export const LEGACY_APPROVE_LIST_STORAGE_KEY = "oa_unified_approve_list_v1";
-
-export function clearLegacyApproveListStorage() {
- try {
- localStorage.removeItem(LEGACY_APPROVE_LIST_STORAGE_KEY);
- } catch {
- /* ignore */
- }
-}
-
/** 鎻愪氦寮圭獥锛氭ā鏉垮崱鐗囷紙鏉ヨ嚜鍚庣鍒楄〃锛� */
export function mapSubmitTemplateCard(row) {
const cfg = parseFormConfigToData(row?.formConfig);
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
index 27706b9..c17e88a 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/useApproveList.js
@@ -34,7 +34,6 @@
buildApproveInstanceDto,
buildEditFormFromInstanceRow,
buildInstanceDto,
- clearLegacyApproveListStorage,
createEmptySubmitForm,
mapInstanceFromApi,
mapSubmitTemplateCard,
@@ -43,7 +42,6 @@
} from "./approveListConstants.js";
export function useApproveList() {
- clearLegacyApproveListStorage();
const userStore = useUserStore();
const tableData = ref([]);
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/components/FormConfigEditor.vue b/src/views/officeProcessAutomation/ApproveManage/approve-template/components/FormConfigEditor.vue
index b63383f..a5d1da7 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/components/FormConfigEditor.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/components/FormConfigEditor.vue
@@ -21,12 +21,20 @@
</el-tag>
</div>
<div class="fce-toolbar-actions">
- <el-dropdown trigger="click" @command="applyPreset">
- <el-button size="small">浠庨璁惧鍏�</el-button>
+ <el-dropdown trigger="click" @visible-change="onImportDropdownVisible" @command="importFromTemplate">
+ <el-button size="small" :loading="templateImportLoading">浠庡凡鏈夋ā鏉垮鍏�</el-button>
<template #dropdown>
<el-dropdown-menu>
- <el-dropdown-item v-for="p in FORM_CONFIG_PRESETS" :key="p.key" :command="p.key">
- {{ p.label }}
+ <el-dropdown-item v-if="!templateImportOptions.length" disabled>
+ 鏆傛棤鍏朵粬瀹℃壒妯℃澘
+ </el-dropdown-item>
+ <el-dropdown-item
+ v-for="t in templateImportOptions"
+ :key="t.id"
+ :command="t.id"
+ >
+ <span>{{ t.label }}</span>
+ <el-tag v-if="!t.enabled" size="small" type="info" class="import-tag">宸插仠鐢�</el-tag>
</el-dropdown-item>
</el-dropdown-menu>
</template>
@@ -38,7 +46,7 @@
<el-empty
v-if="!inner.fields.length"
class="fce-empty"
- description="鏆傛棤濉姤椤癸紝鍙坊鍔犳垨浠庨璁惧揩閫熷鍏�"
+ description="鏆傛棤濉姤椤癸紝鍙坊鍔犳垨浠庡凡鏈夊鎵规ā鏉垮鍏�"
:image-size="72"
/>
@@ -288,14 +296,25 @@
<script setup>
import { Bottom, Delete, Plus, Top } from "@element-plus/icons-vue";
-import { reactive, watch } from "vue";
import {
- FORM_CONFIG_PRESETS,
+ getApprovalTemplateDetail,
+ listApprovalTemplate,
+ TEMPLATE_TYPE_BUILTIN,
+ TEMPLATE_TYPE_CUSTOM,
+} from "@/api/officeProcessAutomation/approvalTemplate.js";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { reactive, ref, watch } from "vue";
+import {
+ mapEnabledFromApi,
+ unwrapTemplateDetail,
+ unwrapTemplateList,
+} from "../approveTemplateConstants.js";
+import {
FORM_FIELD_TYPE_OPTIONS,
- applyFormConfigPreset,
createEmptyFormConfigData,
createEmptyFormField,
formFieldTypeLabel,
+ parseFormConfigToData,
} from "../formConfigUtils.js";
import {
SELECT_OPTION_SOURCE,
@@ -306,6 +325,8 @@
const props = defineProps({
modelValue: { type: Object, default: () => createEmptyFormConfigData() },
+ /** 缂栬緫褰撳墠妯℃澘鏃舵帓闄よ嚜韬紝閬垮厤浠庤嚜宸卞鍏� */
+ excludeTemplateId: { type: [String, Number], default: null },
});
const emit = defineEmits(["update:modelValue"]);
@@ -313,6 +334,9 @@
const inner = reactive(createEmptyFormConfigData());
const { loading: optionSourceLoading, ensureForFields, getOptions } = useSelectOptionSources();
+
+const templateImportOptions = ref([]);
+const templateImportLoading = ref(false);
function typeLabel(type) {
return formFieldTypeLabel(type);
@@ -435,10 +459,66 @@
emitOut();
}
-function applyPreset(key) {
- const data = applyFormConfigPreset(key);
- syncFromProps(data);
- emitOut();
+async function loadTemplateImportOptions() {
+ templateImportLoading.value = true;
+ try {
+ const [customRes, builtinRes] = await Promise.all([
+ listApprovalTemplate(TEMPLATE_TYPE_CUSTOM),
+ listApprovalTemplate(TEMPLATE_TYPE_BUILTIN),
+ ]);
+ const excludeId =
+ props.excludeTemplateId != null && props.excludeTemplateId !== ""
+ ? String(props.excludeTemplateId)
+ : "";
+ templateImportOptions.value = [...unwrapTemplateList(customRes), ...unwrapTemplateList(builtinRes)]
+ .filter((row) => row?.id != null && String(row.id) !== excludeId)
+ .map((row) => ({
+ id: row.id,
+ label: row.templateName || `妯℃澘 #${row.id}`,
+ enabled: mapEnabledFromApi(row.enabled),
+ }));
+ } catch {
+ templateImportOptions.value = [];
+ ElMessage.error("鍔犺浇瀹℃壒妯℃澘鍒楄〃澶辫触");
+ } finally {
+ templateImportLoading.value = false;
+ }
+}
+
+function onImportDropdownVisible(visible) {
+ if (visible) loadTemplateImportOptions();
+}
+
+async function importFromTemplate(templateId) {
+ if (!templateId) return;
+ if (inner.fields.length) {
+ try {
+ await ElMessageBox.confirm("灏嗚鐩栧綋鍓嶅~鎶ラ」閰嶇疆锛屾槸鍚︾户缁紵", "浠庢ā鏉垮鍏�", {
+ type: "warning",
+ confirmButtonText: "缁х画瀵煎叆",
+ cancelButtonText: "鍙栨秷",
+ });
+ } catch {
+ return;
+ }
+ }
+ templateImportLoading.value = true;
+ try {
+ const res = await getApprovalTemplateDetail(templateId);
+ const row = unwrapTemplateDetail(res);
+ const data = parseFormConfigToData(row?.formConfig);
+ if (!data.fields?.length) {
+ ElMessage.warning("璇ユā鏉挎湭閰嶇疆濉姤椤�");
+ return;
+ }
+ syncFromProps(data);
+ emitOut();
+ ElMessage.success(`宸插鍏ャ��${row.templateName || "妯℃澘"}銆嶇殑濉姤椤筦);
+ } catch {
+ ElMessage.error("鍔犺浇妯℃澘璇︽儏澶辫触");
+ } finally {
+ templateImportLoading.value = false;
+ }
}
</script>
@@ -496,6 +576,10 @@
align-items: center;
gap: 8px;
}
+.import-tag {
+ margin-left: 8px;
+ vertical-align: middle;
+}
.fce-empty {
padding: 24px 0;
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
index 59850e2..edd9c56 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/index.vue
@@ -178,7 +178,7 @@
<el-form-item label="濉姤閰嶇疆">
- <FormConfigEditor v-model="form.formConfigData" />
+ <FormConfigEditor v-model="form.formConfigData" :exclude-template-id="form.id" />
<p class="flow-tip">閰嶇疆鎻愪氦瀹℃壒鏃堕渶濉啓鐨勮〃鍗曢」锛屼繚瀛樺悗鍐欏叆 formConfig锛圝SON锛夈��</p>
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js b/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
index 4b2abe4..0dbf2ca 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/useApproveTemplate.js
@@ -23,8 +23,6 @@
} from "./approveTemplateConstants.js";
import { parseFormConfigToData } from "./formConfigUtils.js";
-const LEGACY_STORAGE_KEY = "oa_approve_template_custom_v1";
-
const FALLBACK_TEMPLATE_TYPE_OPTIONS = [
{ value: 0, label: "绯荤粺鍐呯疆" },
{ value: 1, label: "鑷畾涔�" },
@@ -37,17 +35,7 @@
);
}
-function clearLegacyStorage() {
- try {
- localStorage.removeItem(LEGACY_STORAGE_KEY);
- } catch {
- /* ignore */
- }
-}
-
export function useApproveTemplate() {
- clearLegacyStorage();
-
const templateTypeOptions = ref([...FALLBACK_TEMPLATE_TYPE_OPTIONS]);
function templateTypeLabel(type) {
diff --git a/src/views/officeProcessAutomation/AttendManage/leave-apply/index.vue b/src/views/officeProcessAutomation/AttendManage/leave-apply/index.vue
index 7c3849b..30a821b 100644
--- a/src/views/officeProcessAutomation/AttendManage/leave-apply/index.vue
+++ b/src/views/officeProcessAutomation/AttendManage/leave-apply/index.vue
@@ -498,13 +498,9 @@
);
}
-/** 鏈湴妯℃嫙锛氭牴鎹敤鎴风敓鎴愮ǔ瀹氥�屽亣鏈熶綑棰濄�嶅崰浣� */
-function mockLeaveBalance(u) {
- if (!u) return undefined;
- const idStr = String(u.userId ?? u.id ?? "0");
- let s = 0;
- for (let i = 0; i < idStr.length; i++) s += idStr.charCodeAt(i);
- return Math.round(((s % 130) / 10 + 5) * 100) / 100;
+/** 鍋囨湡浣欓锛堝鎺ヨ�冨嫟 API 鍓嶄笉灞曠ず鍋囨暟鎹級 */
+function mockLeaveBalance() {
+ return undefined;
}
function filterUsersByQuery(query) {
@@ -547,45 +543,7 @@
}
}
-/** 鏈湴妯℃嫙鍒楄〃鏁版嵁 */
-const allRows = ref([
- {
- id: "1",
- applicantId: "mock_1",
- applicantNo: "zhangsan",
- applicantName: "寮犱笁",
- leaveType: "annual",
- leaveBalanceDays: 12,
- leaveStartTime: "2026-05-10 09:00:00",
- leaveEndTime: "2026-05-12 18:00:00",
- leaveDurationDays: 2.38,
- leaveReason: "骞翠紤鍋囪繑涔℃帰浜层��",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- approvalResult: "pending",
- attachmentList: [{ name: "杞︾エ璁㈠崟.pdf" }],
- createTime: "2026-05-09 10:20:00",
- },
- {
- id: "2",
- applicantId: "mock_2",
- applicantNo: "lisi",
- applicantName: "鏉庡洓",
- leaveType: "sick",
- leaveBalanceDays: 0,
- leaveStartTime: "2026-05-14 08:30:00",
- leaveEndTime: "2026-05-14 12:00:00",
- leaveDurationDays: 0.15,
- leaveReason: "涓婂崍闂ㄨ瘖澶嶆煡銆�",
- approvalMode: "or_sign",
- approverIds: [],
- approverNames: "",
- approvalResult: "approved",
- attachmentList: [],
- createTime: "2026-05-13 16:00:00",
- },
-]);
+const allRows = ref([]);
const searchForm = reactive({
applicantKeyword: "",
@@ -789,7 +747,7 @@
window.open(url, "_blank");
return;
}
- proxy?.$modal?.msgSuccess?.(`宸叉ā鎷熶笅杞斤細${row.name}`);
+ proxy?.$modal?.msgWarning?.("鏆傛棤涓嬭浇鍦板潃");
}
async function openFormDialog(mode, row) {
@@ -874,7 +832,7 @@
approvalResult: "pending",
createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
});
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
if (idx !== -1) {
@@ -887,7 +845,7 @@
createTime: prev.createTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss"),
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/AttendManage/overtime-apply/index.vue b/src/views/officeProcessAutomation/AttendManage/overtime-apply/index.vue
index 0bdd83f..a58764f 100644
--- a/src/views/officeProcessAutomation/AttendManage/overtime-apply/index.vue
+++ b/src/views/officeProcessAutomation/AttendManage/overtime-apply/index.vue
@@ -404,40 +404,7 @@
}
}
-const allRows = ref([
- {
- id: "1",
- applicantId: "mock_1",
- applicantNo: "zhangsan",
- applicantName: "寮犱笁",
- overtimeType: "weekday",
- overtimeDate: "2026-05-10",
- overtimeStartTime: "2026-05-10 18:00:00",
- overtimeEndTime: "2026-05-10 21:30:00",
- overtimeHours: 3.5,
- overtimeReason: "椤圭洰涓婄嚎淇濋殰銆�",
- approvalFlowNodes: demoApprovalFlowNodes(),
- approvalResult: "pending",
- attachmentList: [{ name: "浠诲姟鍗�.pdf" }],
- createTime: "2026-05-09 10:20:00",
- },
- {
- id: "2",
- applicantId: "mock_2",
- applicantNo: "lisi",
- applicantName: "鏉庡洓",
- overtimeType: "weekend",
- overtimeDate: "2026-05-11",
- overtimeStartTime: "2026-05-11 09:00:00",
- overtimeEndTime: "2026-05-11 12:15:00",
- overtimeHours: 3.25,
- overtimeReason: "瀹㈡埛鐜板満鏀寔銆�",
- approvalFlowNodes: demoApprovalFlowNodes(),
- approvalResult: "approved",
- attachmentList: [],
- createTime: "2026-05-10 16:00:00",
- },
-]);
+const allRows = ref([]);
const searchForm = reactive({
applicantKeyword: "",
@@ -652,7 +619,7 @@
window.open(url, "_blank");
return;
}
- proxy?.$modal?.msgSuccess?.(`宸叉ā鎷熶笅杞斤細${row.name}`);
+ proxy?.$modal?.msgWarning?.("鏆傛棤涓嬭浇鍦板潃");
}
function handleExport() {
@@ -814,7 +781,7 @@
approvalResult: "pending",
createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
});
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
if (idx !== -1) {
@@ -827,7 +794,7 @@
createTime: prev.createTime ?? dayjs().format("YYYY-MM-DD HH:mm:ss"),
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
index edc7f7e..462740e 100644
--- a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
+++ b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/enterpriseNewsUtils.js
@@ -42,17 +42,8 @@
export const STORAGE_KEY = "oa_enterprise_news_v1";
-/** 婕旂ず鐢ㄧ洰鏍囧彈浼楋紙鍚庢湡瀵规帴缁勭粐鏋舵瀯锛� */
-export const MOCK_AUDIENCE = [
- { userId: "u1", employeeNo: "zhangsan", name: "寮犱笁", deptName: "鐮斿彂閮�", isManagement: false },
- { userId: "u2", employeeNo: "lisi", name: "鏉庡洓", deptName: "鐮斿彂閮�", isManagement: false },
- { userId: "u3", employeeNo: "wangwu", name: "鐜嬩簲", deptName: "琛屾斂閮�", isManagement: false },
- { userId: "u4", employeeNo: "zhaoliu", name: "璧靛叚", deptName: "閿�鍞儴", isManagement: false },
- { userId: "u5", employeeNo: "sunqi", name: "瀛欎竷", deptName: "璐㈠姟閮�", isManagement: false },
- { userId: "u6", employeeNo: "zhouba", name: "鍛ㄥ叓", deptName: "鎬荤粡鍔�", isManagement: true },
- { userId: "u7", employeeNo: "wujiu", name: "鍚翠節", deptName: "鎬荤粡鍔�", isManagement: true },
- { userId: "u8", employeeNo: "zhengshi", name: "閮戝崄", deptName: "浜哄姏璧勬簮閮�", isManagement: false },
-];
+/** 鐩爣鍙椾紬锛堝鎺ョ粍缁囨灦鏋� API 鍓嶄负绌猴級 */
+export const MOCK_AUDIENCE = [];
const DEPT_OPTIONS = [
{ value: "101", label: "鐮斿彂閮�" },
@@ -124,13 +115,12 @@
}
function buildReadRecords(readUserIds = []) {
- const set = new Set(readUserIds);
- return MOCK_AUDIENCE.map((u) => ({
- userId: u.userId,
- employeeNo: u.employeeNo,
- name: u.name,
- deptName: u.deptName,
- readAt: set.has(u.userId) ? dayjs().subtract(2, "day").format("YYYY-MM-DD HH:mm:ss") : "",
+ return (readUserIds || []).map((userId) => ({
+ userId,
+ employeeNo: "",
+ name: "",
+ deptName: "",
+ readAt: "",
lastRemindAt: "",
}));
}
@@ -149,158 +139,9 @@
};
}
+/** @deprecated 涓嶅啀娉ㄥ叆婕旂ず鏁版嵁锛屽垵濮嬪垪琛ㄤ负绌� */
export function createInitialMockNews() {
- const policyContent =
- "<p><strong>2026 骞磋�冨嫟绠$悊鍒跺害锛堣瘯琛岋級</strong></p><p>涓�銆佷笂鐝椂闂� 9:00锛屽脊鎬ф墦鍗$獥鍙� 8:30鈥�9:30銆�</p><p>浜屻�佽鍋囬』鎻愬墠鍦� OA 鎻愪氦瀹℃壒銆�</p><p>涓夈�佹湰鍒跺害鑷� 2026-06-01 璧锋墽琛屻��</p>";
- const cultureContent =
- "<p>2026 浼佷笟骞翠細鍦嗘弧钀藉箷锛佹劅璋㈡瘡涓�浣嶅悓浜嬬殑鍙備笌锛屼互涓嬩负绮惧僵鐬棿鍥鹃泦銆�</p>";
- const strategyContent =
- "<p><strong>2026 涓嬪崐骞存垬鐣ユ柟鍚戯紙鍐呴儴锛�</strong></p><p>鑱氱劍鏍稿績浜у搧绾垮崌绾т笌娴峰甯傚満鎷撳睍锛屽叿浣撴寚鏍囪闄勪欢銆�</p>";
-
- const policyRow = {
- id: "news_1",
- newsNo: "EN202605150001",
- title: "鍏充簬鍙戝竷鏂拌�冨嫟鍒跺害鐨勯�氱煡",
- summary: "璇峰叏浣撳憳宸ヨ鐪熼槄璇诲苟纭鐭ユ倝锛岃嚜 2026-06-01 璧锋墽琛屻��",
- newsType: "policy",
- layoutTemplate: "policy",
- contentHtml: policyContent,
- coverImage: "",
- mediaList: [],
- attachmentList: [{ name: "鑰冨嫟鍒跺害2026.pdf", url: "/mock/attendance-policy.pdf" }],
- editorRole: "hr",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "浜哄姏璧勬簮閮�",
- publishTime: "2026-05-15 10:00:00",
- readRecords: buildReadRecords(["u6", "u7", "u8"]),
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [
- {
- versionNo: 1,
- title: "鍏充簬鍙戝竷鏂拌�冨嫟鍒跺害鐨勯�氱煡锛堝緛姹傛剰瑙佺锛�",
- summary: "寰佹眰鎰忚绋�",
- contentHtml: "<p>寰佹眰鎰忚绋匡細涓婄彮鏃堕棿 9:00鈥︹��</p>",
- newsType: "policy",
- publishTime: "2026-05-10 09:00:00",
- archivedAt: "2026-05-15 09:55:00",
- changeNote: "瀹氱鍙戝竷",
- publisherName: "浜哄姏璧勬簮閮�",
- },
- ],
- versionNo: 2,
- requireReadConfirm: true,
- createTime: "2026-05-10 09:00:00",
- updateTime: "2026-05-15 10:00:00",
- };
-
- const cultureRow = {
- id: "news_2",
- newsNo: "EN202605200002",
- title: "2026 浼佷笟骞翠細绮惧僵鐬棿",
- summary: "骞翠細鍥鹃泦涓婄嚎锛屾杩庣偣璧炵暀瑷�锛屽叡寤轰紒涓氭枃鍖栥��",
- newsType: "culture",
- layoutTemplate: "gallery",
- contentHtml: cultureContent,
- coverImage: "/mock/annual-cover.jpg",
- mediaList: [
- { type: "image", name: "寮�鍦�.jpg", url: "/mock/annual-1.jpg" },
- { type: "image", name: "棰佸.jpg", url: "/mock/annual-2.jpg" },
- { type: "video", name: "骞翠細鑺辩诞.mp4", url: "/mock/annual.mp4" },
- ],
- attachmentList: [],
- editorRole: "dept_manager",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "琛屾斂閮�",
- publishTime: "2026-05-20 14:30:00",
- readRecords: buildReadRecords(["u1", "u2", "u3", "u4", "u5", "u6", "u7"]),
- remindLogs: [],
- likes: [
- { userId: "u1", name: "寮犱笁", time: "2026-05-20 15:01:00" },
- { userId: "u2", name: "鏉庡洓", time: "2026-05-20 15:05:00" },
- { userId: "u4", name: "璧靛叚", time: "2026-05-20 16:20:00" },
- ],
- comments: [
- { id: "c1", userId: "u1", name: "寮犱笁", content: "鑺傜洰澶簿褰╀簡锛�", time: "2026-05-20 15:10:00" },
- { id: "c2", userId: "u3", name: "鐜嬩簲", content: "鏈熷緟鏄庡勾鍐嶈仛锛�", time: "2026-05-20 17:00:00" },
- ],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-20 14:00:00",
- updateTime: "2026-05-20 14:30:00",
- };
-
- const strategyRow = {
- id: "news_3",
- newsNo: "EN202605220003",
- title: "2026 涓嬪崐骞存垬鐣ヨ鍒掕鐐�",
- summary: "浠呴檺绠$悊灞傞槄璇伙紝璇峰嬁瀵瑰浼犳挱銆�",
- newsType: "announcement",
- layoutTemplate: "briefing",
- contentHtml: strategyContent,
- coverImage: "",
- mediaList: [],
- attachmentList: [{ name: "鎴樼暐鎸囨爣.pdf", url: "/mock/strategy.pdf" }],
- editorRole: "admin",
- reviewerRole: "admin",
- readScope: "management",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "published",
- publisherName: "鎬荤粡鍔�",
- publishTime: "2026-05-22 09:00:00",
- readRecords: buildReadRecords(["u6", "u7"]),
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-22 08:30:00",
- updateTime: "2026-05-22 09:00:00",
- };
-
- const industryDraft = {
- id: "news_4",
- newsNo: "EN202605250004",
- title: "鍒堕�犱笟鏁板瓧鍖栬浆鍨嬭秼鍔跨畝鎶�",
- summary: "琛屼笟鍔ㄦ�佽崏绋匡紝寰呯鐞嗗憳瀹℃牳鍚庡彂甯冦��",
- newsType: "industry",
- layoutTemplate: "standard",
- contentHtml: "<p>鏈湡绠�鎶ユ⒊鐞嗗伐涓氫簰鑱旂綉涓� AI 璐ㄦ搴旂敤妗堜緥鈥︹��</p>",
- coverImage: "",
- mediaList: [],
- attachmentList: [],
- editorRole: "editor",
- reviewerRole: "admin",
- readScope: "all",
- targetDeptIds: [],
- targetUserIds: [],
- publishStatus: "pending_review",
- publisherName: "甯傚満閮�",
- publishTime: "",
- readRecords: [],
- remindLogs: [],
- likes: [],
- comments: [],
- versions: [],
- versionNo: 1,
- requireReadConfirm: false,
- createTime: "2026-05-25 11:00:00",
- updateTime: "2026-05-25 11:00:00",
- };
-
- return [policyRow, cultureRow, strategyRow, industryDraft];
+ return [];
}
export function loadStoredNews() {
diff --git a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/index.vue b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/index.vue
index a8b743a..8a36ffc 100644
--- a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/index.vue
+++ b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/index.vue
@@ -339,7 +339,7 @@
const name = (galleryInput.value || "").trim();
if (!name) return;
form.mediaList = form.mediaList || [];
- form.mediaList.push({ type: "image", name, url: `/mock/${name}` });
+ form.mediaList.push({ type: "image", name, url: "" });
galleryInput.value = "";
}
diff --git a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/useEnterpriseNews.js b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/useEnterpriseNews.js
index d272b83..d040131 100644
--- a/src/views/officeProcessAutomation/EnterpriseNews/news-manage/useEnterpriseNews.js
+++ b/src/views/officeProcessAutomation/EnterpriseNews/news-manage/useEnterpriseNews.js
@@ -10,7 +10,6 @@
PUBLISH_ROLE_OPTIONS,
DEPT_OPTIONS,
createEmptyForm,
- createInitialMockNews,
loadStoredNews,
saveStoredNews,
getUnreadEmployees,
@@ -24,7 +23,7 @@
export function useEnterpriseNews() {
const stored = loadStoredNews();
- const allRows = ref(stored?.length ? stored : createInitialMockNews());
+ const allRows = ref(stored?.length ? stored : []);
const searchForm = reactive({
keyword: "",
@@ -361,7 +360,7 @@
return { ok: true, count: selectedIds.length };
}
- function toggleLike(row, userId = "u1", userName = "寮犱笁") {
+ function toggleLike(row, userId = "", userName = "") {
const hit = allRows.value.find((r) => r.id === row.id);
if (!hit) return;
hit.likes = hit.likes || [];
@@ -377,7 +376,7 @@
}
}
- function addComment(row, content, userId = "u1", userName = "寮犱笁") {
+ function addComment(row, content, userId = "", userName = "") {
const text = (content || "").trim();
if (!text) return { ok: false, message: "璇疯緭鍏ヨ瘎璁哄唴瀹�" };
const hit = allRows.value.find((r) => r.id === row.id);
diff --git a/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue b/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
index a807e6b..359e335 100644
--- a/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
@@ -424,33 +424,7 @@
return "寰呭鎵�";
}
-/** 鏈湴妯℃嫙鏁版嵁婧� */
-const allRows = ref([
- {
- id: "1",
- applicantName: "鍛ㄦ槑",
- applyDate: "2026-05-01",
- regularizationDate: "2026-06-01",
- probationSummary: "璇曠敤鏈熷唴瀹屾垚妯″潡寮�鍙戜笌鑱旇皟锛岀啛鎮変笟鍔℃祦绋嬨��",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- approvalResult: "pending",
- attachmentList: [{ name: "宸ヤ綔鎬荤粨.pdf" }, { name: "鑰冩牳琛�.xlsx" }],
- },
- {
- id: "2",
- applicantName: "鍚磋姵",
- applyDate: "2026-05-08",
- regularizationDate: "2026-06-10",
- probationSummary: "瀹屾垚鍏ヨ亴鍩硅涓庡矖浣嶅疄璺碉紝杈惧埌宀椾綅瑕佹眰銆�",
- approvalMode: "countersign",
- approverIds: [],
- approverNames: "",
- approvalResult: "approved",
- attachmentList: [],
- },
-]);
+const allRows = ref([]);
const searchForm = reactive({
applicantName: "",
@@ -609,7 +583,7 @@
window.open(url, "_blank");
return;
}
- proxy?.$modal?.msgSuccess?.(`宸叉ā鎷熶笅杞斤細${row.name}`);
+ proxy?.$modal?.msgWarning?.("鏆傛棤涓嬭浇鍦板潃");
}
function openAddWithTemplate() {
@@ -679,7 +653,7 @@
if (formDialog.mode === "add") {
const id = `local_${Date.now()}`;
allRows.value.unshift({ id, ...payload, approvalResult: "pending" });
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
if (idx !== -1) {
@@ -691,7 +665,7 @@
approvalResult: prev.approvalResult ?? "pending",
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/HrManage/transfer-apply/index.vue b/src/views/officeProcessAutomation/HrManage/transfer-apply/index.vue
index 6b72316..02fd505 100644
--- a/src/views/officeProcessAutomation/HrManage/transfer-apply/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/transfer-apply/index.vue
@@ -517,37 +517,7 @@
return "寰呭鎵�";
}
-/** 鏈湴妯℃嫙鍒楄〃鏁版嵁 */
-const allRows = ref([
- {
- id: "1",
- applicantId: "1001",
- applicantName: "鍛ㄦ槑",
- transferDate: "2026-05-20",
- originalPostId: "post_dev",
- originalPostName: "杞欢寮�鍙戝伐绋嬪笀",
- targetPostId: "post_senior_dev",
- targetPostName: "楂樼骇杞欢寮�鍙戝伐绋嬪笀",
- approvalResult: "pending",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- },
- {
- id: "2",
- applicantId: "1002",
- applicantName: "鍚磋姵",
- transferDate: "2026-05-10",
- originalPostId: "post_pm",
- originalPostName: "浜у搧缁忕悊",
- targetPostId: "post_senior_pm",
- targetPostName: "楂樼骇浜у搧缁忕悊",
- approvalResult: "approved",
- approvalMode: "countersign",
- approverIds: [],
- approverNames: "寮犱笁銆佹潕鍥�",
- },
-]);
+const allRows = ref([]);
const searchForm = reactive({
applicantId: "",
@@ -740,7 +710,7 @@
...payload,
approvalResult: "pending",
});
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
const prev = idx !== -1 ? allRows.value[idx] : {};
@@ -751,7 +721,7 @@
...payload,
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/HrManage/work-handover/index.vue b/src/views/officeProcessAutomation/HrManage/work-handover/index.vue
index 2e05b85..ddf6acd 100644
--- a/src/views/officeProcessAutomation/HrManage/work-handover/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/work-handover/index.vue
@@ -502,51 +502,7 @@
return v === "transfer" ? "info" : "";
}
-/** 鏈湴妯℃嫙鍒楄〃鏁版嵁 */
-const allRows = ref([
- {
- id: "1",
- applicantId: "1001",
- applicantName: "鍛ㄦ槑",
- leaveDate: "2026-05-28",
- handoverStatus: "in_progress",
- handoverType: "resignation",
- handoverPersonId: "1003",
- handoverPersonName: "鐜嬪己",
- approvalResult: "pending",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- },
- {
- id: "2",
- applicantId: "1002",
- applicantName: "鍚磋姵",
- leaveDate: "2026-05-15",
- handoverStatus: "completed",
- handoverType: "transfer",
- handoverPersonId: "1004",
- handoverPersonName: "璧垫晱",
- approvalResult: "approved",
- approvalMode: "countersign",
- approverIds: [],
- approverNames: "寮犱笁銆佹潕鍥�",
- },
- {
- id: "3",
- applicantId: "1005",
- applicantName: "闄堟旦",
- leaveDate: "2026-04-20",
- handoverStatus: "returned",
- handoverType: "resignation",
- handoverPersonId: "1006",
- handoverPersonName: "鍒樻磱",
- approvalResult: "rejected",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "鏉庡洓",
- },
-]);
+const allRows = ref([]);
const searchForm = reactive({
applicantId: "",
@@ -759,7 +715,7 @@
...payload,
approvalResult: "pending",
});
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
const prev = idx !== -1 ? allRows.value[idx] : {};
@@ -770,7 +726,7 @@
...payload,
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/noticeAnnouncementUtils.js b/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/noticeAnnouncementUtils.js
index f6b789d..0f2b4ac 100644
--- a/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/noticeAnnouncementUtils.js
+++ b/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/noticeAnnouncementUtils.js
@@ -90,68 +90,9 @@
};
}
+/** @deprecated 涓嶅啀娉ㄥ叆婕旂ず鏁版嵁锛屽垵濮嬪垪琛ㄤ负绌� */
export function createInitialMockNotices() {
- return [
- {
- id: "notice_1",
- noticeNo: "NA202605100001",
- title: "鍏充簬鍙伴澶╂皵灞呭鍔炲叕鐨勭揣鎬ラ�氱煡",
- noticeType: "emergency",
- priority: "urgent",
- contentHtml:
- "<p><strong>绱ф�ラ�氱煡</strong></p><p>鍙楀彴椋庡奖鍝嶏紝鏄庢棩锛�5鏈�17鏃ワ級鍏ㄤ綋鍛樺伐灞呭鍔炲叕锛岃鍚勯儴闂ㄨ礋璐d汉鍋氬ソ宸ヤ綔瀹夋帓涓庡憳宸ヨ仈缁溿��</p>",
- publishDate: "2026-05-16",
- expireDate: "2026-05-20",
- readScope: "all",
- targetDeptIds: [],
- requireReadConfirm: true,
- publishStatus: "published",
- publisherName: "琛屾斂閮�",
- publishTime: "2026-05-16 08:30:00",
- readCount: 128,
- createTime: "2026-05-16 08:00:00",
- updateTime: "2026-05-16 08:30:00",
- },
- {
- id: "notice_2",
- noticeNo: "NA202605120002",
- title: "2026骞寸鍗堣妭鏀惧亣瀹夋帓鍏憡",
- noticeType: "employee",
- priority: "high",
- contentHtml:
- "<p>鏍规嵁鍥藉娉曞畾鑺傚亣鏃ュ畨鎺掞紝绔崍鑺傛斁鍋囨椂闂翠负 6鏈�8鏃ヨ嚦6鏈�10鏃ワ紝鍏�3澶┿��6鏈�7鏃ワ紙鍛ㄥ叚锛夋甯镐笂鐝��</p>",
- publishDate: "2026-05-12",
- expireDate: "2026-06-15",
- readScope: "all",
- targetDeptIds: [],
- requireReadConfirm: false,
- publishStatus: "published",
- publisherName: "浜哄姏璧勬簮閮�",
- publishTime: "2026-05-12 10:00:00",
- readCount: 256,
- createTime: "2026-05-12 09:30:00",
- updateTime: "2026-05-12 10:00:00",
- },
- {
- id: "notice_3",
- noticeNo: "NA202605140003",
- title: "鍔炲叕鍖哄煙娑堥槻婕旂粌閫氱煡",
- noticeType: "company",
- priority: "normal",
- contentHtml: "<p>瀹氫簬 5鏈�25鏃� 14:00 鍦ㄦ�婚儴澶фゼ杩涜娑堥槻婕旂粌锛岃鍚勯儴闂ㄦ彁鍓嶅畨鎺掍汉鍛樺弬鍔犮��</p>",
- publishDate: "2026-05-14",
- expireDate: "2026-05-26",
- readScope: "department",
- targetDeptIds: ["101", "102", "103"],
- requireReadConfirm: false,
- publishStatus: "draft",
- publisherName: "琛屾斂閮�",
- publishTime: "",
- readCount: 0,
- createTime: "2026-05-14 15:00:00",
- updateTime: "2026-05-14 15:00:00",
- },
- ];
+ return [];
}
export function loadStoredNotices() {
diff --git a/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js b/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js
index c9a9d9f..0019252 100644
--- a/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js
+++ b/src/views/officeProcessAutomation/NoticeAnnouncement/notice-manage/useNoticeAnnouncement.js
@@ -9,7 +9,6 @@
READ_SCOPE_OPTIONS,
DEPT_OPTIONS,
createEmptyForm,
- createInitialMockNotices,
loadStoredNotices,
saveStoredNotices,
nextNoticeNo,
@@ -22,7 +21,7 @@
export function useNoticeAnnouncement() {
const stored = loadStoredNotices();
- const allRows = ref(stored?.length ? stored : createInitialMockNotices());
+ const allRows = ref(stored?.length ? stored : []);
const searchForm = reactive({
keyword: "",
diff --git a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/costReimburseUtils.js b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/costReimburseUtils.js
index 8cb8fa0..012e4d8 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/costReimburseUtils.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/costReimburseUtils.js
@@ -65,12 +65,12 @@
},
};
-/** 瀹℃壒瑙掕壊涓庢ā鎷熷鎵逛汉 */
-export const MOCK_APPROVERS_BY_ROLE = {
- direct_supervisor: { approverId: "mock_supervisor", approverName: "鐩村睘涓婄骇" },
- dept_manager: { approverId: "mock_manager", approverName: "閮ㄩ棬缁忕悊" },
- cfo: { approverId: "mock_cfo", approverName: "璐㈠姟鎬荤洃" },
- compliance: { approverId: "mock_compliance", approverName: "鍚堣瀹℃牳" },
+/** 瀹℃壒瑙掕壊灞曠ず鍚嶏紙鑺傜偣瀹℃壒浜洪』鍦ㄥ墠绔�夋嫨锛� */
+export const APPROVAL_ROLE_LABELS = {
+ direct_supervisor: "鐩村睘涓婄骇",
+ dept_manager: "閮ㄩ棬缁忕悊",
+ cfo: "璐㈠姟鎬荤洃",
+ compliance: "鍚堣瀹℃牳",
};
/** 鎸夐噾棰濋璁惧鎵归摼 */
@@ -151,19 +151,16 @@
export function buildAutoApprovalFlow(amount, expenseCategory) {
const roles = resolveApprovalRoles(amount, expenseCategory);
- return roles.map((role, i) => {
- const mock = MOCK_APPROVERS_BY_ROLE[role] || { approverId: `mock_${role}`, approverName: role };
- return {
- approverId: mock.approverId,
- approverName: mock.approverName,
- roleKey: role,
- sortOrder: i + 1,
- nodeOrder: i + 1,
- nodeStatus: i === 0 ? "process" : "wait",
- approveOpinion: "",
- approveTime: "",
- };
- });
+ return roles.map((role, i) => ({
+ approverId: null,
+ approverName: APPROVAL_ROLE_LABELS[role] || role,
+ roleKey: role,
+ sortOrder: i + 1,
+ nodeOrder: i + 1,
+ nodeStatus: i === 0 ? "process" : "wait",
+ approveOpinion: "",
+ approveTime: "",
+ }));
}
export function getApprovalRuleHint(amount, expenseCategory) {
@@ -171,7 +168,7 @@
const rule = APPROVAL_AMOUNT_RULES.find((r) => amt <= r.maxAmount) || APPROVAL_AMOUNT_RULES[APPROVAL_AMOUNT_RULES.length - 1];
const extra = CATEGORY_EXTRA_APPROVAL[expenseCategory] || [];
const extraText = extra.length
- ? `锛�${expenseCategoryLabel(expenseCategory)}绫诲彟闇�锛�${extra.map((r) => MOCK_APPROVERS_BY_ROLE[r]?.approverName || r).join("銆�")}`
+ ? `锛�${expenseCategoryLabel(expenseCategory)}绫诲彟闇�锛�${extra.map((r) => APPROVAL_ROLE_LABELS[r] || r).join("銆�")}`
: "";
return `${rule.description}${extraText}`;
}
diff --git a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
index 79ffe6b..a37ee4e 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/cost-reimburse/useCostReimburse.js
@@ -42,105 +42,7 @@
export function useCostReimburse() {
const { proxy } = getCurrentInstance();
- const allRows = ref([
- {
- id: "1",
- reimburseNo: "CR202605100001",
- applicantId: "mock_1",
- employeeNo: "zhangsan",
- employeeName: "寮犱笁",
- applicantNo: "zhangsan",
- applicantName: "寮犱笁",
- expenseCategory: "office_procurement",
- reimburseReason: "閲囪喘鎵撳嵃鏈虹榧撱�丄4绾哥瓑鍔炲叕鑰楁潗銆�",
- applyAmount: 680,
- payee: "寮犱笁",
- payeeAccount: "6222 **** **** 1234",
- bankBranch: "涓浗宸ュ晢閾惰鏉窞瑗挎箹鏀",
- expenseDetails: [
- { id: "d1", invoiceDate: "2026-05-08", expenseSubject: "office_supply", amount: 380, description: "A4澶嶅嵃绾�" },
- { id: "d2", invoiceDate: "2026-05-08", expenseSubject: "office_supply", amount: 300, description: "纭掗紦" },
- ],
- attachmentList: [{ name: "閲囪喘鍙戠エ.pdf", url: "/mock/invoice1.pdf" }],
- approvalFlowNodes: demoFlowNodes(680, "office_procurement"),
- currentNodeIndex: 0,
- approvalResult: "pending",
- rejectReason: "",
- approvalRecords: [],
- applyTime: "2026-05-10 09:15:00",
- createTime: "2026-05-10 09:15:00",
- deptId: "101",
- deptName: "琛屾斂閮�",
- },
- {
- id: "2",
- reimburseNo: "CR202605080002",
- applicantId: "mock_2",
- employeeNo: "lisi",
- employeeName: "鏉庡洓",
- applicantNo: "lisi",
- applicantName: "鏉庡洓",
- expenseCategory: "business_entertainment",
- reimburseReason: "鎺ュ緟閲嶇偣瀹㈡埛鍟嗗姟瀹磋銆�",
- applyAmount: 3200,
- payee: "鏉庡洓",
- payeeAccount: "6217 **** **** 5678",
- bankBranch: "鎷涘晢閾惰姝︽眽鍏夎胺鏀",
- expenseDetails: [
- { id: "d3", invoiceDate: "2026-05-06", expenseSubject: "entertainment", amount: 3200, description: "瀹㈡埛瀹磋" },
- ],
- attachmentList: [],
- approvalFlowNodes: demoFlowNodes(3200, "business_entertainment").map((n, i) => ({
- ...n,
- nodeStatus: i === 0 ? "error" : "wait",
- approveOpinion: i === 0 ? "鍙戠エ妯$硦闇�閲嶄紶" : "",
- approveTime: i === 0 ? "2026-05-09 14:20:00" : "",
- })),
- currentNodeIndex: 0,
- approvalResult: "rejected",
- rejectReason: "鍙戠エ妯$硦闇�閲嶄紶",
- approvalRecords: [
- { operatorName: "鐩村睘涓婄骇", result: "rejected", opinion: "鍙戠エ妯$硦闇�閲嶄紶", time: "2026-05-09 14:20:00" },
- ],
- applyTime: "2026-05-07 16:30:00",
- createTime: "2026-05-07 16:30:00",
- deptId: "102",
- deptName: "閿�鍞儴",
- },
- {
- id: "3",
- reimburseNo: "CR202605050003",
- applicantId: "mock_3",
- employeeNo: "wangwu",
- employeeName: "鐜嬩簲",
- applicantNo: "wangwu",
- applicantName: "鐜嬩簲",
- expenseCategory: "communication",
- reimburseReason: "5鏈堝洜鍏瘽璐规姤閿�銆�",
- applyAmount: 198,
- payee: "鐜嬩簲",
- payeeAccount: "6228 **** **** 9012",
- bankBranch: "涓浗寤鸿閾惰鎴愰兘楂樻柊鏀",
- expenseDetails: [
- { id: "d4", invoiceDate: "2026-05-05", expenseSubject: "phone", amount: 198, description: "璇濊垂璐﹀崟" },
- ],
- attachmentList: [{ name: "璇濊垂璐﹀崟.jpg", url: "/mock/phone.jpg" }],
- approvalFlowNodes: demoFlowNodes(198, "communication").map((n) => ({
- ...n,
- nodeStatus: "finish",
- approveOpinion: "鍚屾剰",
- approveTime: "2026-05-06 10:00:00",
- })),
- currentNodeIndex: 0,
- approvalResult: "approved",
- rejectReason: "",
- approvalRecords: [{ operatorName: "鐩村睘涓婄骇", result: "approved", opinion: "鍚屾剰", time: "2026-05-06 10:00:00" }],
- applyTime: "2026-05-05 11:00:00",
- createTime: "2026-05-05 11:00:00",
- deptId: "103",
- deptName: "鎶�鏈儴",
- },
- ]);
+ const allRows = ref([]);
const searchForm = reactive({
applicantKeyword: "",
@@ -508,7 +410,7 @@
applyTime: now,
createTime: now,
});
- proxy?.$modal?.msgSuccess?.("鎻愪氦鎴愬姛锛屽凡杩涘叆瀹℃壒锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鎻愪氦鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
if (idx !== -1) {
@@ -525,7 +427,7 @@
createTime: prev.createTime,
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
diff --git a/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/travelReimburseUtils.js b/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/travelReimburseUtils.js
index d898614..2505ce3 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/travelReimburseUtils.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/travelReimburseUtils.js
@@ -137,19 +137,10 @@
return { nodes, currentNodeIndex: idx, approvalResult: "rejected", rejectReason: opinion || "椹冲洖" };
}
-/** 妯℃嫙閮ㄩ棬棰勭畻锛堜笌棰勭畻绯荤粺鑱斿姩鍗犱綅锛� */
+/** 閮ㄩ棬棰勭畻锛堝鎺ラ绠楃郴缁熷墠杩斿洖绌猴級 */
export function mockDeptBudget(deptId) {
- const id = String(deptId || "default");
- let s = 0;
- for (let i = 0; i < id.length; i++) s += id.charCodeAt(i);
- const total = 500000 + (s % 200) * 1000;
- const used = (s % 80) * 3500;
- return {
- deptId: id,
- totalBudget: total,
- usedAmount: used,
- remainingAmount: Math.max(0, total - used),
- };
+ if (!deptId) return null;
+ return null;
}
export function normalizeImportedRow(raw, idx) {
diff --git a/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/useTravelReimburse.js b/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/useTravelReimburse.js
index 9125d64..847e54f 100644
--- a/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/useTravelReimburse.js
+++ b/src/views/officeProcessAutomation/ReimburseManage/travel-reimburse/useTravelReimburse.js
@@ -32,92 +32,10 @@
return String(u.status) === "0";
}
-function demoFlowNodes(names = ["閮ㄩ棬涓荤", "璐㈠姟瀹℃牳"]) {
- return names.map((name, i) => ({
- approverId: `mock_${i + 1}`,
- approverName: name,
- sortOrder: i + 1,
- nodeOrder: i + 1,
- nodeStatus: i === 0 ? "process" : "wait",
- approveOpinion: "",
- approveTime: "",
- }));
-}
-
export function useTravelReimburse() {
const { proxy } = getCurrentInstance();
- const allRows = ref([
- {
- id: "1",
- reimburseNo: "TR202605090001",
- applicantId: "mock_1",
- employeeNo: "zhangsan",
- employeeName: "寮犱笁",
- applicantNo: "zhangsan",
- applicantName: "寮犱笁",
- reimburseReason: "璧翠笂娴峰弬鍔犺涓氬睍浼氬強瀹㈡埛鎷滆銆�",
- travelStartTime: "2026-05-10 08:00:00",
- travelEndTime: "2026-05-13 18:00:00",
- travelDays: 4,
- departurePlace: "鏉窞",
- destination: "涓婃捣",
- hotelStandard: 600,
- hotelDays: 3,
- livingSubsidy: 400,
- applyAmount: 4580,
- payee: "寮犱笁",
- expenseDetails: [
- { id: "d1", invoiceDate: "2026-05-10", expenseSubject: "transport", amount: 553, description: "楂橀搧寰�杩�" },
- { id: "d2", invoiceDate: "2026-05-11", expenseSubject: "hotel", amount: 1680, description: "閰掑簵浣忓" },
- ],
- attachmentList: [{ name: "楂橀搧绁�.pdf", url: "/mock/invoice1.pdf" }],
- invoiceAttachments: [{ name: "楂橀搧绁�.pdf", url: "/mock/invoice1.pdf" }],
- approvalFlowNodes: demoFlowNodes(),
- currentNodeIndex: 0,
- approvalResult: "pending",
- rejectReason: "",
- approvalRecords: [],
- needSpecialApproval: false,
- deptId: "101",
- deptName: "閿�鍞儴",
- travelTier: "tier1",
- createTime: "2026-05-09 10:20:00",
- },
- {
- id: "2",
- reimburseNo: "TR202605080002",
- applicantId: "mock_2",
- employeeNo: "lisi",
- employeeName: "鏉庡洓",
- applicantNo: "lisi",
- applicantName: "鏉庡洓",
- reimburseReason: "鎴愰兘鍒嗗叕鍙告妧鏈敮鎸併��",
- travelStartTime: "2026-05-05 09:00:00",
- travelEndTime: "2026-05-07 17:00:00",
- travelDays: 3,
- departurePlace: "姝︽眽",
- destination: "鎴愰兘",
- hotelStandard: 450,
- hotelDays: 2,
- livingSubsidy: 240,
- applyAmount: 2100,
- payee: "鏉庡洓",
- expenseDetails: [{ id: "d3", invoiceDate: "2026-05-06", expenseSubject: "meal", amount: 180, description: "宸ヤ綔椁�" }],
- attachmentList: [],
- invoiceAttachments: [],
- approvalFlowNodes: demoFlowNodes().map((n, i) => ({ ...n, nodeStatus: "finish", approveOpinion: "鍚屾剰", approveTime: "2026-05-08 11:00:00" })),
- currentNodeIndex: 1,
- approvalResult: "approved",
- rejectReason: "",
- approvalRecords: [{ operatorName: "閮ㄩ棬涓荤", result: "approved", opinion: "鍚屾剰", time: "2026-05-08 10:00:00" }],
- needSpecialApproval: false,
- deptId: "102",
- deptName: "鎶�鏈儴",
- travelTier: "tier2",
- createTime: "2026-05-07 16:00:00",
- },
- ]);
+ const allRows = ref([]);
const searchForm = reactive({ applicantKeyword: "", travelStartFrom: "", travelEndTo: "" });
const tableLoading = ref(false);
@@ -534,7 +452,7 @@
approvalRecords: [],
createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
});
- proxy?.$modal?.msgSuccess?.("鎻愪氦鎴愬姛锛屽凡杩涘叆瀹℃壒锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("鎻愪氦鎴愬姛");
} else {
const idx = allRows.value.findIndex((r) => r.id === form.id);
if (idx !== -1) {
@@ -549,7 +467,7 @@
createTime: prev.createTime,
};
}
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
+ proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛");
}
formDialog.visible = false;
handleQuery();
--
Gitblit v1.9.3