0513新功能优化

This commit is contained in:
lzm
2026-05-13 11:41:30 +08:00
parent ddc0c7db1e
commit 5cb913cb0a
20 changed files with 442 additions and 229 deletions

View File

@@ -166,7 +166,9 @@
</el-col>
<el-col :span="15">
<ContentWrap v-if="currentPlanning">
<div v-loading="quarterLoading" class="min-h-320px">
<template v-if="currentPlanning">
<ContentWrap>
<div class="mb-16px flex items-center justify-between gap-16px">
<div>
<div class="text-16px font-600">{{ currentPlanning.planningContent }}</div>
@@ -298,7 +300,7 @@
</el-descriptions>
</ContentWrap>
<ContentWrap v-if="currentPlanning">
<ContentWrap>
<div class="mb-16px flex items-center justify-between gap-16px">
<div>
<div class="text-14px font-600">季度分配</div>
@@ -348,7 +350,7 @@
</el-col>
</el-row>
<el-table v-loading="quarterLoading" :data="quarterRows" border>
<el-table :data="quarterRows" border>
<el-table-column align="center" label="分配年度" width="150" prop="distributionYear" />
<el-table-column
v-for="quarter in QUARTER_OPTIONS"
@@ -366,10 +368,12 @@
</el-table-column>
</el-table>
</ContentWrap>
</template>
<ContentWrap v-else>
<ContentWrap v-else-if="!quarterLoading">
<el-empty description="请选择合约规划后查看测算结果和季度分配" />
</ContentWrap>
</div>
</el-col>
</el-row>
@@ -581,12 +585,11 @@ const getPlanningList = async () => {
}
const loadPlanningDetail = async (planningId: number) => {
const planning = await PlanningApi.getProjectPlanning(planningId)
currentPlanning.value = planning
quarterLoading.value = true
try {
const quarterList = await PlanningQuarterApi.getProjectPlanningQuarterListByPlanningId(planningId)
quarterRows.value = buildQuarterRows(planning, quarterList)
const detail = await PlanningQuarterApi.getProjectPlanningQuarterPlanningDetail(planningId)
currentPlanning.value = detail?.planning
quarterRows.value = detail?.planning ? buildQuarterRows(detail.planning, detail.quarters || []) : []
} finally {
quarterLoading.value = false
}
@@ -643,11 +646,18 @@ const handlePlanningOutputFormSuccess = async () => {
}
}
let activatedOnce = false
onMounted(() => {
getProjectList()
})
onActivated(() => {
// KeepAlive 首次挂载也会触发 onActivated跳过首轮避免重复请求项目与合约规划列表。
if (!activatedOnce) {
activatedOnce = true
return
}
getProjectList()
})
</script>