| | |
| | | getTravelStandardByTier, |
| | | } from "../_utils/travelReimburseUtils.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | | // 延迟初始化 userStore,避免在模块加载时调用 |
| | | let userStore = null; |
| | | function getUserStore() { |
| | | if (!userStore) { |
| | | userStore = useUserStore(); |
| | | } |
| | | return userStore; |
| | | } |
| | | |
| | | function buildOverBudgetWarnings(f, detailTotal, hotelLimit, transportLimit, mealLimit) { |
| | | const warnings = []; |
| | |
| | | /** 新增时默认带出当前登录人,减少选人步骤 */ |
| | | function tryApplyCurrentUser() { |
| | | if (modeRef.value === "edit" || form.applicantId) return; |
| | | const id = userStore.id; |
| | | const store = getUserStore(); |
| | | const id = store.id; |
| | | if (!id) return; |
| | | let u = userById(id); |
| | | if (!u) { |
| | | u = { |
| | | userId: id, |
| | | nickName: userStore.nickName, |
| | | userName: userStore.name, |
| | | nickName: store.nickName, |
| | | userName: store.name, |
| | | }; |
| | | } |
| | | fillApplicantFromUser(u); |