Files
bj_power/bj_power_wms/frontend/src/pages/Dashboard.vue
T
SunYF f1cf57e9b2 feat: 新增工序签字功能,移除移料指令模块
新增操作工/检验员工序签字功能,支持工艺步骤配置签字要求;删除移料指令相关代码,将移料页签重命名为产线点位(上料/下料);新增成品入库功能及相关权限;优化备料单状态、质量状态逻辑,新增批次序号字段;修复AGV取消后备料单回退状态问题。
2026-10-05 20:15:38 +08:00

107 lines
4.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup>
defineOptions({ name: 'Dashboard' })
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { CircleCheck, Download, List, Monitor, Search, Upload, Box, Tickets, EditPen, Location, Goods } from '@element-plus/icons-vue'
import request from '../utils/request'
import PageHelp from '../components/PageHelp.vue'
import { helpDashboard } from '../help'
import { fmtNum } from '../utils/format'
const router = useRouter()
const overview = ref({})
const loaded = ref(false)
// 缺货预警(客户诉求 问题记录 L473:安全库存/缺货预警进 WMS 首页)
const shortage = ref([])
async function load() {
overview.value = await request.get('/display/overview')
loaded.value = true
}
async function loadShortage() {
try {
const d = await request.get('/stock/shortage')
shortage.value = d?.list || []
} catch (e) {
shortage.value = []
}
}
onMounted(() => {
load()
loadShortage()
})
const cards = [
{ key: 'totalQty', label: '在库总量' },
{ key: 'snInStock', label: 'SN 在库数' },
{ key: 'semiInStock', label: '半成品在库' },
{ key: 'packageCount', label: '装箱出库' },
{ key: 'batchCount', label: '批次数' },
{ key: 'inToday', label: '今日入库单' },
{ key: 'outToday', label: '今日出库单' }
]
const entries = [
{ path: '/inbound', title: '入库管理', icon: Download },
{ path: '/outbound', title: '备料出库', icon: Upload },
{ path: '/inventory', title: '库存查询', icon: Search },
{ path: '/inspection', title: '质量检验', icon: CircleCheck },
{ path: '/stocktake', title: '库存盘点', icon: List },
{ path: '/semi', title: '半成品管理', icon: Box },
{ path: '/ledger', title: '工单备料台账', icon: Tickets },
{ path: '/zone', title: '区域维护', icon: Location },
{ path: '/material', title: '物料档案', icon: Goods },
{ path: '/display', title: '免登录大屏', icon: Monitor }
]
</script>
<template>
<div>
<el-row :gutter="12">
<el-col v-for="c in cards" :key="c.key" :xs="12" :sm="8" :md="6" style="margin-bottom:12px">
<el-card shadow="hover">
<div class="kpi-label">{{ c.label }}</div>
<div class="kpi-value">{{ loaded ? fmtNum(overview[c.key]) : '—' }}</div>
</el-card>
</el-col>
</el-row>
<el-card v-if="shortage.length" shadow="never" class="mb12" style="margin-top:12px">
<template #header>
<span style="color:#f56c6c;font-weight:600">缺货预警({{ shortage.length }} 项物料可用量低于安全库存)</span>
</template>
<el-table :data="shortage" border size="small" empty-text="暂无缺货物料">
<el-table-column prop="materialCode" label="图号" min-width="140" />
<el-table-column prop="materialName" label="物料名称" min-width="150" />
<el-table-column prop="spec" label="规格" min-width="110">
<template #default="{ row }">{{ row.spec || '-' }}</template>
</el-table-column>
<el-table-column prop="safetyStock" label="安全库存" width="100" align="center" />
<el-table-column prop="availQty" label="可用量" width="90" align="center" />
<el-table-column label="缺口" width="90" align="center">
<template #default="{ row }">
<span style="color:#f56c6c;font-weight:600">{{ row.shortQty }}</span>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card shadow="never" header="快捷入口">
<div class="entries">
<el-button v-for="e in entries" :key="e.path" size="large"
@click="router.push(e.path)">
<el-icon style="margin-right:6px"><component :is="e.icon" /></el-icon>{{ e.title }}
</el-button>
</div>
</el-card>
<PageHelp :data="helpDashboard" page="Dashboard" />
</div>
</template>
<style scoped>
.kpi-label { color: #909399; font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 4px; color: #303133; }
.entries { display: flex; flex-wrap: wrap; gap: 10px; }
</style>