Files
2026-08-08 18:28:49 +08:00

93 lines
5.0 KiB
PHP

<?php
$activeMenu = 'asdTestData';
include APP_PATH . 'app/views/layouts/admin_header.php';
?>
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-flask"></i> 测试数据管理</h3>
<div class="box-tools">
<a href="<?php echo BASE_URL; ?>/Admin/asdTestDataImport" class="btn btn-success btn-sm">
<i class="fa fa-plus"></i> 导入测试数据
</a>
<span class="badge bg-blue" style="margin-left:10px;">共 <?php echo $totalCount; ?> 条记录</span>
</div>
</div>
<div class="box-header">
<form method="get" action="<?php echo BASE_URL; ?>/Admin/asdTestData" class="form-inline">
<div class="input-group input-group-sm" style="width:300px;">
<input type="text" name="keyword" class="form-control" placeholder="输入条码搜索..." value="<?php echo htmlspecialchars($keyword ?? ''); ?>">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
</span>
</div>
</form>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>条码</th>
<th>项目名称</th>
<th>测试员</th>
<th>工位</th>
<th>设备</th>
<th>状态</th>
<th>工步数</th>
<th>失败数</th>
<th>测试时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php if (empty($records)): ?>
<tr><td colspan="11" class="text-center text-muted">暂无测试数据</td></tr>
<?php else: ?>
<?php foreach ($records as $r): ?>
<tr>
<td><?php echo $r['id']; ?></td>
<td><code><?php echo htmlspecialchars($r['qr_code']); ?></code></td>
<td><?php echo htmlspecialchars($r['project_name']); ?></td>
<td><?php echo htmlspecialchars($r['tester']); ?></td>
<td><?php echo htmlspecialchars($r['site']); ?></td>
<td><?php echo htmlspecialchars($r['device']); ?></td>
<td>
<?php if ($r['status'] === 'PASS'): ?>
<span class="label label-success">PASS</span>
<?php else: ?>
<span class="label label-danger"><?php echo htmlspecialchars($r['status']); ?></span>
<?php endif; ?>
</td>
<td><span class="badge bg-light-blue"><?php echo $r['step_count']; ?></span></td>
<td>
<?php if ($r['fail_count'] > 0): ?>
<span class="badge bg-red"><?php echo $r['fail_count']; ?></span>
<?php else: ?>
<span class="text-muted">0</span>
<?php endif; ?>
</td>
<td><?php echo $r['test_time'] ?? '-'; ?></td>
<td>
<a href="<?php echo BASE_URL; ?>/Admin/asdTestDataView/<?php echo $r['id']; ?>" class="btn btn-xs btn-info" title="查看详情">
<i class="fa fa-eye"></i>
</a>
<form method="post" action="<?php echo BASE_URL; ?>/Admin/asdTestDataDelete/<?php echo $r['id']; ?>" style="display:inline;" onsubmit="return confirm('确定删除该测试记录及所有工步数据吗?');">
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
<button type="submit" class="btn btn-xs btn-danger" title="删除"><i class="fa fa-trash"></i></button>
</form>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>