师级别

This commit is contained in:
18631081161 2026-01-17 21:40:41 +08:00
parent cb2f2ef5f9
commit 3ea47545f6

View File

@ -64,7 +64,7 @@
</template>
</el-table-column>
<!-- 师团级显示总配额,团级显示本单位配额,营部及以下隐藏配额 -->
<el-table-column v-if="authStore.canCreateAllocations" prop="totalQuota" label="总配额" width="120" align="right">
<el-table-column v-if="authStore.canCreateAllocations" prop="totalQuota" label="总配额" width="120" align="center">
<template #default="{ row }">
<span class="quota-value">{{ formatNumber(row.totalQuota) }}</span>
</template>
@ -76,18 +76,10 @@
</div>
</template>
</el-table-column>
<!-- 师团级显示分配情况,团级显示消耗情况(含总数和百分比),营部及以下只显示上报数量 -->
<el-table-column v-if="authStore.canCreateAllocations" label="分配情况" width="150" align="center">
<!-- 师团级显示总消耗,团级显示消耗情况(含总数和百分比),营部及以下只显示上报数量 -->
<el-table-column v-if="authStore.canCreateAllocations" label="总消耗" width="120" align="center">
<template #default="{ row }">
<div class="distribution-info">
<span class="dist-count">{{ row.distributions?.length || 0 }} 个单位</span>
<el-progress
:percentage="getDistributionPercentage(row)"
:stroke-width="6"
:show-text="false"
style="width: 60px; margin-left: 8px"
/>
</div>
<span class="consumed-value">{{ formatNumber(getTotalActualCompletion(row)) }}</span>
</template>
</el-table-column>
<el-table-column v-else-if="authStore.organizationalLevelNum === 2" label="消耗情况" width="200" align="center">
@ -175,7 +167,7 @@
</div>
</div>
</el-col>
<!-- 师团级显示总配额已分配分配单位数 -->
<!-- 师团级显示总配额总消耗分配单位数 -->
<template v-if="authStore.canCreateAllocations">
<el-col :span="6">
<div class="summary-item">
@ -188,9 +180,9 @@
</el-col>
<el-col :span="6">
<div class="summary-item">
<div class="summary-label">已分配</div>
<div class="summary-value allocated">
<span class="number">{{ formatNumber(getTotalDistributed()) }}</span>
<div class="summary-label">总消耗</div>
<div class="summary-value consumed">
<span class="number">{{ formatNumber(getTotalConsumed()) }}</span>
<span class="unit">{{ selectedAllocation?.unit }}</span>
</div>
</div>
@ -549,6 +541,11 @@ function getDistributionPercentage(allocation: MaterialAllocation): number {
return Math.round((distributed / allocation.totalQuota) * 100)
}
function getTotalActualCompletion(allocation: MaterialAllocation): number {
if (!allocation.distributions || allocation.distributions.length === 0) return 0
return allocation.distributions.reduce((sum, d) => sum + (d.actualCompletion || 0), 0)
}
function getMyUnitQuota(allocation: MaterialAllocation): number {
if (!authStore.user || !allocation.distributions) return 0
//
@ -776,6 +773,12 @@ onMounted(() => {
font-size: 14px;
}
.consumed-value {
font-weight: 600;
color: #67C23A;
font-size: 14px;
}
.quota-cell {
display: flex;
justify-content: center;