师级别
This commit is contained in:
parent
cb2f2ef5f9
commit
3ea47545f6
|
|
@ -64,7 +64,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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 }">
|
<template #default="{ row }">
|
||||||
<span class="quota-value">{{ formatNumber(row.totalQuota) }}</span>
|
<span class="quota-value">{{ formatNumber(row.totalQuota) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -76,18 +76,10 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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 }">
|
<template #default="{ row }">
|
||||||
<div class="distribution-info">
|
<span class="consumed-value">{{ formatNumber(getTotalActualCompletion(row)) }}</span>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-else-if="authStore.organizationalLevelNum === 2" label="消耗情况" width="200" align="center">
|
<el-table-column v-else-if="authStore.organizationalLevelNum === 2" label="消耗情况" width="200" align="center">
|
||||||
|
|
@ -175,7 +167,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 师团级显示总配额、已分配、分配单位数 -->
|
<!-- 师团级显示总配额、总消耗、分配单位数 -->
|
||||||
<template v-if="authStore.canCreateAllocations">
|
<template v-if="authStore.canCreateAllocations">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div class="summary-item">
|
<div class="summary-item">
|
||||||
|
|
@ -188,9 +180,9 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div class="summary-item">
|
<div class="summary-item">
|
||||||
<div class="summary-label">已分配</div>
|
<div class="summary-label">总消耗</div>
|
||||||
<div class="summary-value allocated">
|
<div class="summary-value consumed">
|
||||||
<span class="number">{{ formatNumber(getTotalDistributed()) }}</span>
|
<span class="number">{{ formatNumber(getTotalConsumed()) }}</span>
|
||||||
<span class="unit">{{ selectedAllocation?.unit }}</span>
|
<span class="unit">{{ selectedAllocation?.unit }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -549,6 +541,11 @@ function getDistributionPercentage(allocation: MaterialAllocation): number {
|
||||||
return Math.round((distributed / allocation.totalQuota) * 100)
|
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 {
|
function getMyUnitQuota(allocation: MaterialAllocation): number {
|
||||||
if (!authStore.user || !allocation.distributions) return 0
|
if (!authStore.user || !allocation.distributions) return 0
|
||||||
// 先查找分配给当前单位的配额
|
// 先查找分配给当前单位的配额
|
||||||
|
|
@ -776,6 +773,12 @@ onMounted(() => {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.consumed-value {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #67C23A;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.quota-cell {
|
.quota-cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user