盘库操作初设计

This commit is contained in:
dxc
2026-02-06 10:16:37 +08:00
parent c1ddb8093f
commit e027ebd4a9
15 changed files with 1227 additions and 30 deletions

View File

@ -0,0 +1,31 @@
import request from '@/utils/request'
// 获取全量库存
// 修改前: url: '/api/v1/inbound/stock/all'
// 修改后: url: '/v1/inbound/stock/all'
export function getAllStock() {
return request({
url: '/v1/inbound/stock/all',
method: 'get'
})
}
// 打印出库选单
// 修改后: 去掉开头的 /api
export function printSelectionList(items: any[]) {
return request({
url: '/v1/inbound/stock/print/selection',
method: 'post',
data: { items }
})
}
// 打印盘点报告
// 修改后: 去掉开头的 /api
export function printStocktakeReport(data: any) {
return request({
url: '/v1/inbound/stock/print/stocktake',
method: 'post',
data
})
}

View File

@ -0,0 +1,219 @@
<template>
<div class="qr-scanner-container">
<div id="qr-reader" class="scanner-box"></div>
<div v-if="errorMsg" class="error-msg">{{ errorMsg }}</div>
<div class="focus-tip" v-if="!errorMsg">
<div class="scan-line"></div>
<div class="scan-text">将条码对准取景框</div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
import { Html5Qrcode, Html5QrcodeSupportedFormats } from 'html5-qrcode'
const emit = defineEmits(['decode', 'error'])
const errorMsg = ref('')
let html5QrCode: Html5Qrcode | null = null
const scannerElementId = "qr-reader"
const startScanning = async () => {
try {
// 1. 实例化
html5QrCode = new Html5Qrcode(scannerElementId, {
useBarCodeDetectorIfSupported: true,
formatsToSupport: [
Html5QrcodeSupportedFormats.CODE_128,
Html5QrcodeSupportedFormats.QR_CODE
],
verbose: false
})
// 2. 启动配置
const config = {
fps: 25,
qrbox: { width: 250, height: 100 }, // 扫描区域设置
// ★★★ 修复点1移除 aspectRatio让画面自适应容器长宽比 ★★★
// aspectRatio: 1.0,
disableFlip: false,
videoConstraints: {
facingMode: "environment",
// 限制分辨率,保证速度
width: { min: 640, ideal: 1280, max: 1920 },
height: { min: 480, ideal: 720, max: 1080 },
focusMode: "continuous"
}
}
// 3. 启动
await html5QrCode.start(
{ facingMode: "environment" },
config,
(decodedText) => {
console.log(`Scan: ${decodedText}`)
emit('decode', decodedText)
},
(errorMessage) => {
// ignore
}
)
} catch (err: any) {
let msg = '无法启动摄像头'
const errStr = err.toString()
if (errStr.includes('Permission')) msg = '请允许摄像头权限'
else if (errStr.includes('Secure')) msg = '需要 HTTPS 或 localhost'
else if (errStr.includes('NotFound')) msg = '未检测到摄像头'
console.error("Scanner Error:", err)
errorMsg.value = msg
emit('error', msg)
}
}
const stopScanning = async () => {
if (html5QrCode) {
try {
if (html5QrCode.isScanning) {
await html5QrCode.stop()
}
html5QrCode.clear()
} catch (e) {
console.error("Stop failed", e)
}
}
}
onMounted(() => {
setTimeout(() => {
startScanning()
}, 300)
})
onUnmounted(() => {
stopScanning()
})
</script>
<style scoped>
.qr-scanner-container {
width: 100%;
height: 100%;
position: relative;
background-color: #000;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: hidden; /* 关键:裁剪多余画面 */
border-radius: 12px; /* 保持圆角 */
}
.scanner-box {
width: 100%;
height: 100%;
position: relative;
}
/* ★★★ 修复点2强制 Video 元素填满容器 ★★★ */
:deep(#qr-reader) {
width: 100%;
height: 100%;
border: none !important;
padding: 0 !important;
}
:deep(#qr-reader video) {
width: 100% !important;
height: 100% !important;
object-fit: cover !important; /* 关键:保持比例铺满,裁剪多余部分 */
border-radius: 12px;
display: block !important;
}
/* 隐藏 html5-qrcode 可能自带的遮罩层,我们用自己的 */
:deep(#qr-reader__scan_region) {
display: none !important;
}
/* 自定义错误提示 */
.error-msg {
position: absolute;
top: 50%;
left: 0;
width: 100%;
text-align: center;
color: #fff;
background: rgba(245, 108, 108, 0.85);
padding: 15px;
transform: translateY(-50%);
z-index: 20;
}
/* --- 视觉辅助线 --- */
.focus-tip {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 250px;
height: 120px;
/* 使用半透明黑边框模拟遮罩效果,突出中间区域 */
box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.6);
border: 1px solid rgba(255, 255, 255, 0.6);
border-radius: 8px;
pointer-events: none;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
}
/* 四个角的装饰 */
.focus-tip::before,
.focus-tip::after {
content: '';
position: absolute;
width: 20px;
height: 20px;
border-color: #409EFF;
border-style: solid;
border-width: 0;
}
.focus-tip::before {
top: -1px; left: -1px;
border-top-width: 3px;
border-left-width: 3px;
}
.focus-tip::after {
bottom: -1px; right: -1px;
border-bottom-width: 3px;
border-right-width: 3px;
}
/* 红色扫描线动画 */
.scan-line {
width: 90%;
height: 2px;
background: #ff0000;
box-shadow: 0 0 4px #ff0000;
animation: scan-move 2s infinite linear;
}
.scan-text {
position: absolute;
bottom: -30px;
color: #fff;
font-size: 12px;
opacity: 0.8;
}
@keyframes scan-move {
0% { transform: translateY(-40px); opacity: 0; }
10% { opacity: 1; }
90% { opacity: 1; }
100% { transform: translateY(40px); opacity: 0; }
}
</style>

View File

@ -46,7 +46,7 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/inventory',
component: Layout,
meta: { title: '入库管理', icon: 'Shop' }, // 修改标题以区分出库
meta: { title: '入库管理', icon: 'Shop' },
redirect: '/inventory/buy',
children: [
{
@ -67,7 +67,7 @@ const routes: Array<RouteRecordRaw> = [
component: () => import('@/views/stock/inbound/product.vue'),
meta: { title: '成品' }
},
// ★ [新增] 入库记录整合
// [原有] 入库记录整合
{
path: 'summary',
name: 'InventorySummary',
@ -79,17 +79,31 @@ const routes: Array<RouteRecordRaw> = [
name: 'InventoryService',
component: () => import('@/views/stock/inbound/service.vue'),
meta: { title: '服务权益' }
},
// ★ [新增] 库存盘点页面 (查库/消除)
{
path: 'stocktake',
name: 'InventoryStocktake',
component: () => import('@/views/stock/stocktake/index.vue'),
meta: { title: '库存盘点' }
}
]
},
// 5. ★ [新增] 出库管理
// 5. 出库管理
{
path: '/outbound', // 注意:这里使用了和你提供的文件路径一致的顶级路径
path: '/outbound',
component: Layout,
meta: { title: '出库管理', icon: 'Van' }, // 推荐使用 Van 图标
meta: { title: '出库管理', icon: 'Van' },
redirect: '/outbound/index',
children: [
// ★ [新增] 出库选单打印页面
{
path: 'selection',
name: 'OutboundSelection',
component: () => import('@/views/outbound/Selection.vue'),
meta: { title: '出库选单' }
},
{
path: 'create',
name: 'OutboundCreate',

View File

@ -0,0 +1,302 @@
<template>
<div class="app-container">
<el-card shadow="always">
<template #header>
<div class="card-header">
<div class="header-left">
<span class="title">出库拣货选单</span>
<span class="subtitle">(打印目标: 192.168.9.205)</span>
</div>
<div>
<el-button type="success" :icon="Printer" :disabled="selectedItems.length === 0" @click="handlePreview">
生成并预览出库单
</el-button>
</div>
</div>
</template>
<div class="filter-container">
<el-row :gutter="20">
<el-col :span="12">
<el-input
v-model="searchKeyword"
placeholder="请输入物料名称 或 规格型号 进行搜索"
class="search-input"
clearable
:prefix-icon="Search"
/>
</el-col>
<el-col :span="12" style="text-align: right;">
<el-button type="primary" plain :icon="Upload" @click="handleImportBom">
导入 BOM
</el-button>
<el-button type="primary" plain :icon="Plus" @click="handleCreateBom">
创建 BOM
</el-button>
</el-col>
</el-row>
</div>
<el-alert
v-if="selectedItems.length > 0"
:title="`当前已选中 ${selectedItems.length} 项物品`"
type="success"
show-icon
style="margin-bottom: 15px"
:closable="false"
/>
<el-table
v-loading="loading"
:data="filteredTableData"
style="width: 100%"
@selection-change="handleSelectionChange"
row-key="uuid"
border
height="600"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="类型" width="100" align="center">
<template #default="{ row }">
<el-tag :type="getTypeTag(row.type)">{{ row.typeLabel }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="name" label="名称" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<span v-html="highlightKeyword(row.name)"></span>
</template>
</el-table-column>
<el-table-column prop="standard" label="规格型号" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<span v-html="highlightKeyword(row.standard)"></span>
</template>
</el-table-column>
<el-table-column prop="batch_no" label="批号" width="120" />
<el-table-column prop="uuid" label="条码UUID" width="280" show-overflow-tooltip />
<el-table-column prop="create_time" label="入库时间" width="170" />
</el-table>
</el-card>
<el-dialog
v-model="previewVisible"
title="出库单打印预览"
width="800px"
destroy-on-close
>
<div class="print-preview-content">
<el-alert title="请核对以下清单,确认无误后点击下方【确认打印】按钮" type="warning" :closable="false" style="margin-bottom: 10px;" />
<el-table :data="selectedItems" border size="small" style="width: 100%">
<el-table-column prop="typeLabel" label="类型" width="80" />
<el-table-column prop="name" label="名称" />
<el-table-column prop="standard" label="规格" />
<el-table-column prop="batch_no" label="批号" width="100" />
<el-table-column prop="uuid" label="条码UUID" show-overflow-tooltip />
</el-table>
<div class="summary-info" style="margin-top: 20px; text-align: right; font-weight: bold;">
总计出库数量: <span style="color: red; font-size: 18px;">{{ selectedItems.length }}</span>
</div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="previewVisible = false">取消</el-button>
<el-button type="primary" :loading="printLoading" @click="confirmPrint">
确认打印
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { Printer, Search, Upload, Plus } from '@element-plus/icons-vue'
import { getAllStock, printSelectionList } from '@/api/inbound/stock'
import { ElMessage, ElMessageBox } from 'element-plus'
// --- 类型定义 ---
interface BaseStockItem {
id: number | string;
standard: string;
batch_no: string;
uuid: string;
create_time: string;
// 原始数据中可能存在的字段
material_name?: string;
product_name?: string;
}
// 统一后的显示对象
interface DisplayItem extends BaseStockItem {
name: string; // 统一后的名称
type: 'material' | 'semi' | 'product'; // 类型标识
typeLabel: string; // 类型中文名
}
// --- 状态变量 ---
const loading = ref(false)
const printLoading = ref(false)
const searchKeyword = ref('') // 搜索关键词
const previewVisible = ref(false) // 预览弹窗控制
// 原始扁平化数据
const allStockData = ref<DisplayItem[]>([])
// 当前选中的行
const selectedItems = ref<DisplayItem[]>([])
// --- 计算属性:前端模糊搜索过滤 ---
const filteredTableData = computed(() => {
const keyword = searchKeyword.value.trim().toLowerCase()
if (!keyword) {
return allStockData.value
}
return allStockData.value.filter(item => {
const nameMatch = item.name && item.name.toLowerCase().includes(keyword)
const stdMatch = item.standard && item.standard.toLowerCase().includes(keyword)
// 也可以加上UUID搜索
const uuidMatch = item.uuid && item.uuid.toLowerCase().includes(keyword)
return nameMatch || stdMatch || uuidMatch
})
})
// --- 方法 ---
// 1. 获取并处理数据
const fetchData = async () => {
loading.value = true
try {
const res: any = await getAllStock()
// 假设 res 结构为 { materials: [], semis: [], products: [] }
const materials = (res.materials || []).map((item: any) => ({
...item,
name: item.material_name,
type: 'material',
typeLabel: '采购件'
}))
const semis = (res.semis || []).map((item: any) => ({
...item,
name: item.material_name || item.product_name, // 半成品字段名不确定,做个兼容
type: 'semi',
typeLabel: '半成品'
}))
const products = (res.products || []).map((item: any) => ({
...item,
name: item.product_name,
type: 'product',
typeLabel: '成品'
}))
// 合并所有数据
allStockData.value = [...materials, ...semis, ...products]
} catch (error) {
console.error(error)
ElMessage.error('无法获取库存数据')
} finally {
loading.value = false
}
}
// 2. 表格选择
const handleSelectionChange = (val: DisplayItem[]) => {
selectedItems.value = val
}
// 3. 点击“生成并预览”
const handlePreview = () => {
if (selectedItems.value.length === 0) {
ElMessage.warning('请先勾选需要出库的物品')
return
}
previewVisible.value = true
}
// 4. 确认打印 (在弹窗中触发)
const confirmPrint = async () => {
printLoading.value = true
try {
// 这里调用真实的打印接口
await printSelectionList(selectedItems.value)
ElMessage.success('指令已发送,请前往打印机(192.168.9.205)取单')
previewVisible.value = false // 关闭弹窗
// 可选:打印后是否清空选中?
// selectedItems.value = []
// 注意el-table 需要调用 clearSelection 方法来清空UI选中状态
} catch (err) {
ElMessage.error('打印请求失败')
} finally {
printLoading.value = false
}
}
// 5. BOM 操作占位函数
const handleImportBom = () => {
// TODO: 打开上传文件的 Dialog 或者跳转页面
ElMessage.info('点击了导入BOM请实现具体逻辑')
}
const handleCreateBom = () => {
// TODO: 打开新建 BOM 的表单
ElMessage.info('点击了创建BOM请实现具体逻辑')
}
// 辅助函数:高亮关键词 (可选)
const highlightKeyword = (text: string) => {
if (!searchKeyword.value || !text) return text
const reg = new RegExp(searchKeyword.value, 'gi')
return text.replace(reg, (match) => `<span style="color: red; font-weight: bold;">${match}</span>`)
}
// 辅助函数:标签颜色
const getTypeTag = (type: string) => {
switch (type) {
case 'material': return 'info'
case 'semi': return 'warning'
case 'product': return 'success'
default: return ''
}
}
onMounted(() => {
fetchData()
})
</script>
<style scoped>
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.header-left .title {
font-size: 18px;
font-weight: bold;
margin-right: 10px;
}
.header-left .subtitle {
font-size: 12px;
color: #909399;
}
.filter-container {
margin-bottom: 20px;
background-color: #f5f7fa;
padding: 15px;
border-radius: 4px;
}
.search-input {
width: 100%;
max-width: 400px;
}
</style>

View File

@ -0,0 +1,391 @@
<template>
<div class="app-container mobile-optimized">
<el-card class="main-card" shadow="never">
<template #header>
<div class="header-row">
<div class="title">
<span>📷 库存盘点</span>
<el-tag v-if="!showList" type="success" size="small" effect="dark">扫描中</el-tag>
<el-tag v-else type="info" size="small">暂停</el-tag>
</div>
<el-button type="primary" plain @click="openInventoryList" icon="List">
查看清单/手动查找
</el-button>
</div>
</template>
<div class="scanner-container">
<div v-if="!showList" class="camera-active-box">
<QrScanner @decode="onScanSuccess" />
<div class="scan-overlay-tip">将条码对准取景框</div>
</div>
<div v-else class="camera-paused-box" @click="showList = false">
<el-icon :size="60" color="#909399"><VideoPause /></el-icon>
<p>正在查看清单<br>摄像头已暂停</p>
<el-button type="primary" link>点击返回扫描</el-button>
</div>
</div>
<div class="stats-dashboard">
<div class="stat-card">
<div class="stat-val">{{ stats.total }}</div>
<div class="stat-label">应盘总数</div>
</div>
<div class="stat-card success">
<div class="stat-val">{{ stats.scanned }}</div>
<div class="stat-label">已扫(相符)</div>
</div>
<div class="stat-card error">
<div class="stat-val">{{ stats.missing }}</div>
<div class="stat-label">差异(未扫)</div>
</div>
</div>
<div class="main-actions">
<el-button
type="danger"
size="large"
class="finish-btn"
@click="handleFinish"
:loading="printing"
:disabled="stats.total === 0"
icon="Printer"
>
结束盘点并打印差异报告
</el-button>
<p class="printer-tip">目标打印机: 192.168.9.205</p>
</div>
</el-card>
<el-drawer
v-model="showList"
title="📦 在库物品清单"
direction="btt"
size="90%"
:with-header="true"
destroy-on-close
class="inventory-drawer"
>
<div class="drawer-content">
<div class="search-bar">
<el-input
v-model="searchKeyword"
placeholder="搜索名称 / 规格 / 条码"
prefix-icon="Search"
clearable
size="large"
/>
<el-select
v-model="filterType"
placeholder="类型"
style="width: 100px; margin-left: 8px;"
size="large"
>
<el-option label="全部" value="all" />
<el-option label="采购" value="material" />
<el-option label="半成品" value="semi" />
<el-option label="成品" value="product" />
</el-select>
</div>
<el-table
:data="filteredList"
height="100%"
style="width: 100%; flex: 1;"
stripe
border
row-key="uniqueKey"
>
<el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip />
<el-table-column prop="standard" label="规格" min-width="100" show-overflow-tooltip />
<el-table-column prop="uuid" label="条码后6位" width="100">
<template #default="scope">
{{ scope.row.uuid ? '...' + scope.row.uuid.slice(-6) : '-' }}
</template>
</el-table-column>
<el-table-column label="状态" width="80" align="center" fixed="right">
<template #default="scope">
<el-tag v-if="scope.row.scanned" type="success" effect="dark">已盘</el-tag>
<el-tag v-else type="danger" effect="plain">未扫</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { getAllStock, printStocktakeReport } from '@/api/inbound/stock'
import QrScanner from '@/components/QrScanner/index.vue'
import { ElMessage, ElNotification, ElMessageBox } from 'element-plus'
import { Search, List, Printer, VideoPause } from '@element-plus/icons-vue'
// --- 类型定义 ---
interface StockItem {
id: number
name: string
standard: string
batch_no: string
uuid: string
bar_code: string
scanned: boolean
category_type: 'material' | 'semi' | 'product'
category_label: string
uniqueKey: string
[key: string]: any
}
// --- 状态管理 ---
const printing = ref(false)
const showList = ref(false) // 控制抽屉显示
const filterType = ref('all')
const searchKeyword = ref('')
const allData = ref<StockItem[]>([])
// --- 初始化 ---
const init = async () => {
try {
const res = await getAllStock()
const list: StockItem[] = []
const processItem = (item: any, type: 'material' | 'semi' | 'product', label: string) => {
const name = item.material_name || item.product_name || item.name || '未知物品'
return {
...item,
name: name,
standard: item.standard || '',
batch_no: item.batch_no || item.batch_number || '',
uuid: item.uuid || item.sku || '',
bar_code: item.bar_code || item.barcode || '',
scanned: false,
category_type: type,
category_label: label,
uniqueKey: `${type}_${item.id}`
}
}
if (res.materials) res.materials.forEach((i: any) => list.push(processItem(i, 'material', '采购件')))
if (res.semis) res.semis.forEach((i: any) => list.push(processItem(i, 'semi', '半成品')))
if (res.products) res.products.forEach((i: any) => list.push(processItem(i, 'product', '成品')))
allData.value = list
ElMessage.success(`加载成功,共 ${list.length} 件物品`)
} catch (e) {
ElMessage.error('库存加载失败,请重试')
}
}
// --- 打开清单 (同时会自动触发 v-if 销毁摄像头) ---
const openInventoryList = () => {
showList.value = true
}
// --- 过滤逻辑 ---
const filteredList = computed(() => {
let result = allData.value
if (filterType.value !== 'all') {
result = result.filter(item => item.category_type === filterType.value)
}
if (searchKeyword.value) {
const kw = searchKeyword.value.toLowerCase().trim()
result = result.filter(item =>
(item.name && item.name.toLowerCase().includes(kw)) ||
(item.standard && item.standard.toLowerCase().includes(kw)) ||
(item.uuid && item.uuid.toLowerCase().includes(kw)) ||
(item.bar_code && item.bar_code.toLowerCase().includes(kw))
)
}
return result
})
const stats = computed(() => {
const total = allData.value.length
const scanned = allData.value.filter(i => i.scanned).length
return { total, scanned, missing: total - scanned }
})
// --- 扫码逻辑 ---
const onScanSuccess = (code: string) => {
if (!code) return
const trimCode = code.trim()
const item = allData.value.find(i => i.uuid === trimCode || i.bar_code === trimCode)
if (item) {
if (item.scanned) {
ElMessage.warning(`${item.name} 已扫过`)
return
}
item.scanned = true
// 震动反馈 (如果设备支持)
if (navigator.vibrate) navigator.vibrate(200);
ElNotification({
title: '✅ 匹配成功',
message: `${item.name}\n${item.standard}`,
type: 'success',
duration: 2000,
position: 'top-left' // 移动端通常顶部提示更明显
})
} else {
ElMessage.error(`未找到: ${trimCode}`)
if (navigator.vibrate) navigator.vibrate([100, 50, 100]);
}
}
// --- 结束打印 ---
const handleFinish = async () => {
if (stats.value.total === 0) return
try {
await ElMessageBox.confirm(
`应盘: ${stats.value.total} | 差异: ${stats.value.missing}\n确认结束并打印`,
'结束盘点',
{ confirmButtonText: '打印报告', cancelButtonText: '取消', type: 'warning', center: true }
)
const missingItems = allData.value.filter(i => !i.scanned)
const payload = {
total: stats.value.total,
scanned: stats.value.scanned,
missing: stats.value.missing,
missing_items: missingItems
}
printing.value = true
await printStocktakeReport(payload)
ElMessage.success('打印指令已发送')
} catch (e) {
if (e !== 'cancel') ElMessage.error('打印失败')
} finally {
printing.value = false
}
}
onMounted(() => {
init()
})
</script>
<style scoped>
/* 移动端容器适配 */
.app-container.mobile-optimized {
padding: 10px;
max-width: 600px; /* 在平板/PC上限制宽度保持手机观感 */
margin: 0 auto;
}
/* 头部样式 */
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.header-row .title {
display: flex;
flex-direction: column;
gap: 4px;
font-weight: bold;
font-size: 16px;
}
/* 扫描区域 */
.scanner-container {
height: 35vh; /* 占据屏幕高度的 35% */
background: #000;
border-radius: 12px;
overflow: hidden;
margin-bottom: 15px;
position: relative;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.camera-active-box {
width: 100%;
height: 100%;
}
.scan-overlay-tip {
position: absolute;
bottom: 10px;
left: 0;
width: 100%;
text-align: center;
color: rgba(255, 255, 255, 0.8);
font-size: 12px;
background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
padding: 10px 0;
pointer-events: none;
}
.camera-paused-box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #f0f2f5;
color: #909399;
cursor: pointer;
text-align: center;
}
/* 统计仪表盘 */
.stats-dashboard {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.stat-card {
flex: 1;
background: #f8f9fa;
border-radius: 8px;
padding: 15px 5px;
text-align: center;
border: 1px solid #ebeef5;
}
.stat-card .stat-val {
font-size: 24px;
font-weight: 800;
line-height: 1.2;
}
.stat-card .stat-label {
font-size: 12px;
color: #909399;
margin-top: 4px;
}
.stat-card.success .stat-val { color: #67c23a; }
.stat-card.error .stat-val { color: #f56c6c; }
/* 底部按钮 */
.main-actions {
margin-top: 10px;
}
.finish-btn {
height: 50px;
font-size: 16px;
border-radius: 25px; /* 圆角按钮更好点 */
}
.printer-tip {
text-align: center;
font-size: 12px;
color: #909399;
margin-top: 12px;
}
/* 抽屉内容布局 */
.drawer-content {
height: 100%;
display: flex;
flex-direction: column;
padding: 10px;
}
.search-bar {
display: flex;
margin-bottom: 10px;
}
</style>