营
This commit is contained in:
parent
35578e7fa2
commit
d5040eb1e8
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div class="dashboard">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<!-- 师团级和团级显示物资配额 -->
|
||||
<el-col v-if="authStore.organizationalLevelNum <= 2" :span="6">
|
||||
<el-card class="stat-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
|
@ -13,7 +14,8 @@
|
|||
<div class="stat-label">总配额条数</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<!-- 师团级和团级显示完成率 -->
|
||||
<el-col v-if="authStore.organizationalLevelNum <= 2" :span="6">
|
||||
<el-card class="stat-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
|
@ -25,7 +27,7 @@
|
|||
<div class="stat-label">平均完成率</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="authStore.organizationalLevelNum <= 2 ? 6 : 12">
|
||||
<el-card class="stat-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
|
@ -37,7 +39,7 @@
|
|||
<div class="stat-label">人员总数</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="authStore.organizationalLevelNum <= 2 ? 6 : 12">
|
||||
<el-card class="stat-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
|
|
|||
|
|
@ -63,20 +63,20 @@
|
|||
<span class="unit-text">{{ row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 师团级显示总配额,团部及以下显示本单位配额 -->
|
||||
<!-- 师团级显示总配额,团级显示本单位配额,营部及以下隐藏配额 -->
|
||||
<el-table-column v-if="authStore.canCreateAllocations" prop="totalQuota" label="总配额" width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="quota-value">{{ formatNumber(row.totalQuota) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else prop="unitQuota" label="配额" width="100" align="center">
|
||||
<el-table-column v-else-if="authStore.organizationalLevelNum === 2" prop="unitQuota" label="配额" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="quota-cell">
|
||||
<span class="quota-number">{{ formatNumber(getMyUnitQuota(row)) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 师团级显示分配情况,团部及以下显示消耗情况 -->
|
||||
<!-- 师团级显示分配情况,团级显示消耗情况(含总数和百分比),营部及以下只显示上报数量 -->
|
||||
<el-table-column v-if="authStore.canCreateAllocations" label="分配情况" width="150" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="distribution-info">
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else label="消耗情况" width="200" align="center">
|
||||
<el-table-column v-else-if="authStore.organizationalLevelNum === 2" label="消耗情况" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="consumption-cell">
|
||||
<div class="consumption-numbers">
|
||||
|
|
@ -106,6 +106,13 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else label="已上报" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="report-cell">
|
||||
<span class="report-number">{{ formatNumber(getMyActualCompletion(row)) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="authStore.canCreateAllocations" prop="createdByUnitName" label="创建单位" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="createdAt" label="创建时间" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
|
|
@ -198,8 +205,8 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</template>
|
||||
<!-- 团部及以下显示本单位配额、总消耗 -->
|
||||
<template v-else>
|
||||
<!-- 团级显示本单位配额、总消耗 -->
|
||||
<template v-else-if="authStore.organizationalLevelNum === 2">
|
||||
<el-col :span="9">
|
||||
<div class="summary-item">
|
||||
<div class="summary-label">本单位配额</div>
|
||||
|
|
@ -219,6 +226,28 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</template>
|
||||
<!-- 营部及以下只显示物资类别和总消耗,并增加上报消耗按钮 -->
|
||||
<template v-else>
|
||||
<el-col :span="9">
|
||||
<div class="summary-item">
|
||||
<div class="summary-label">总消耗</div>
|
||||
<div class="summary-value consumed">
|
||||
<span class="number">{{ formatNumber(getTotalConsumed()) }}</span>
|
||||
<span class="unit">{{ selectedAllocation?.unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<div class="summary-item action-item">
|
||||
<div class="summary-label">操作</div>
|
||||
<div class="summary-value">
|
||||
<el-button type="primary" @click="handleReportFromSummary">
|
||||
上报消耗
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
|
@ -495,6 +524,21 @@ function handleReportConsumption(distribution: AllocationDistribution) {
|
|||
})
|
||||
}
|
||||
|
||||
function handleReportFromSummary() {
|
||||
if (!selectedAllocation.value) return
|
||||
// 获取第一个分配记录(营部及以下账号看到的是上级单位的配额)
|
||||
const distribution = distributions.value[0] || selectedAllocation.value.distributions?.[0]
|
||||
if (distribution) {
|
||||
router.push({
|
||||
path: `/allocations/${selectedAllocation.value.id}/report`,
|
||||
query: {
|
||||
distributionId: distribution.id,
|
||||
targetUnitId: distribution.targetUnitId
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function handleViewReports(distribution: AllocationDistribution) {
|
||||
selectedDistribution.value = distribution
|
||||
showReportsDialog.value = true
|
||||
|
|
@ -691,6 +735,20 @@ onMounted(() => {
|
|||
color: #606266;
|
||||
}
|
||||
|
||||
.report-cell {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.report-number {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #67C23A;
|
||||
font-family: 'Arial', sans-serif;
|
||||
}
|
||||
|
||||
.time-cell {
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
|
|
@ -734,6 +792,16 @@ onMounted(() => {
|
|||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.summary-item.action-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.summary-item.action-item .summary-value {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user