feat(wms): 增加呆滞库存天数查询条件

- 在查询表单中添加呆滞天数输入框,默认值为180天
- 支持用户自定义呆滞天数范围(1-3650天)
- 更新统计逻辑以使用动态呆滞天数阈值- 调整超过6个月未出库的显示为动态天数标签- 移除呆滞原因列以简化报表展示
-修复数量统计时可能存在的NaN问题
- 注释掉原有的Excel和CSV导出按钮
master
zangch@mesnac.com 2 months ago
parent fad1c8db78
commit dbdcc0557e

@ -1,6 +1,10 @@
export interface ReportQuery {
tenantId?: string;
materialCategoryId?: number;
/**
*
*/
stagnantDays?: number;
}
export interface ReturnReasonAnalysisVO {

@ -34,8 +34,8 @@
<el-form-item>
<el-button type="primary" @click="handleQuery"></el-button>
<el-button @click="resetQuery"></el-button>
<el-button type="success" @click="handleExportExcel">Excel</el-button>
<el-button @click="handleExportCsv">CSV</el-button>
<!-- <el-button type="success" @click="handleExportExcel">Excel</el-button>
<el-button @click="handleExportCsv">CSV</el-button>-->
</el-form-item>
</el-form>
</el-card>

@ -4,7 +4,10 @@
:leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
<el-form-item label="呆滞天数(天)">
<el-input-number v-model="queryParams.stagnantDays" :min="1" :max="3650" :step="30" controls-position="right" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
@ -39,7 +42,7 @@
<el-card shadow="hover" class="stat-card">
<div class="stat-item">
<div class="stat-value text-orange-500">{{ stagnantStats.overSixMonths }}</div>
<div class="stat-label">超过6个月未出库</div>
<div class="stat-label">超过{{ queryParams.stagnantDays }}未出库</div>
</div>
</el-card>
</el-col>
@ -89,7 +92,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="呆滞原因" align="center" prop="stagnantReason" />
<!-- <el-table-column label="呆滞原因" align="center" prop="stagnantReason" /> -->
<el-table-column label="物料规格" align="center" prop="materialSpec" show-overflow-tooltip />
<el-table-column label="所在仓库" align="center" prop="warehouseName" />
</el-table>
@ -131,7 +134,8 @@ const queryFormRef = ref<ElFormInstance>();
const queryParams = ref<ReportQuery>({
tenantId: undefined,
materialCategoryId: undefined
materialCategoryId: undefined,
stagnantDays: 180
});
/** 查询呆滞料库存报表列表 */
@ -152,10 +156,11 @@ const getList = async () => {
/** 计算统计数据 */
const calculateStats = () => {
const overThresholdLabel = `超过${queryParams.value.stagnantDays ?? 180}天未出库`;
stagnantStats.value = {
neverOut: reportList.value.filter(item => item.stagnantReason === '从未出库').length,
overSixMonths: reportList.value.filter(item => item.stagnantReason === '超过6个月未出库').length,
totalQty: reportList.value.reduce((sum, item) => sum + (item.stagnantInventoryQty || 0), 0)
overSixMonths: reportList.value.filter(item => item.stagnantReason === overThresholdLabel).length,
totalQty: reportList.value.reduce((sum, item) => sum + Number(item.stagnantInventoryQty ?? 0), 0)
};
};

Loading…
Cancel
Save