This commit is contained in:
ywb
2026-06-13 14:07:19 +08:00
parent 48121b2a05
commit cbc88def27
14 changed files with 626 additions and 80 deletions
+96 -4
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>设置 - AGV 拍摄系统</title>
<link rel="stylesheet" href="/static/css/style.css?v=20260529b">
<link rel="stylesheet" href="/static/css/style.css?v=20260612b">
</head>
<body>
<div id="app">
@@ -25,6 +25,7 @@
<button class="tab" :class="{active: tab === 'model'}" @click="tab = 'model'">📦 机型配置</button>
<button class="tab" :class="{active: tab === 'arm'}" @click="tab = 'arm'">🤖 机械臂</button>
<button class="tab" :class="{active: tab === 'agv'}" @click="tab = 'agv'">🚗 AGV控制</button>
<button class="tab" :class="{active: tab === 'customs'}" @click="tab = 'customs'">📋 报关单</button>
</div>
<main class="container">
@@ -435,7 +436,7 @@
<!-- 机械臂摄像头画面 -->
<div style="margin-bottom:8px">
<div class="camera-preview" style="max-width:640px">
<img :src="armCameraUrl" @error="onArmPreviewError" style="width:100%;border-radius:8px">
<img :src="armCameraUrl" @error="onArmPreviewError" class="camera-img arm">
</div>
</div>
<div style="display:flex;justify-content:flex-end;margin-bottom:16px">
@@ -499,7 +500,7 @@
</div>
<div v-else>
<div class="camera-preview">
<img :src="armCameraUrl" @error="onArmPreviewError">
<img :src="armCameraUrl" @error="onArmPreviewError" class="camera-img arm">
</div>
<div class="joints-panel">
<h3>关节角度控制</h3>
@@ -587,6 +588,97 @@
</div>
</section>
</div>
<!-- ========== 报关单 Tab ========== -->
<div v-if="tab === 'customs'">
<section class="card">
<div style="display:flex;justify-content:space-between;align-items:center">
<h2>📋 报关单列表</h2>
<button class="btn btn-secondary" @click="loadCustomsList" :disabled="customsLoading">
<span v-if="customsLoading"></span><span v-else>🔄</span> 刷新
</button>
</div>
<p class="hint" style="margin-bottom:12px">选择报关单查看其中的机器列表,点击报关单 ID 展开机器信息</p>
<!-- 分页表格 -->
<div class="table-wrapper">
<table class="data-table">
<thead>
<tr>
<th style="width:60px">序号</th>
<th>报关单号</th>
<th>名称</th>
<th>状态</th>
<th>机器数</th>
<th style="width:80px">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, idx) in customsPageData" :key="item.id || idx"
class="clickable-row"
:class="{ 'row-selected': selectedCustomsId === (item.id || item.customsId || item.customs_id) }"
@click="selectCustomsRow(item, idx)">
<td>{% raw %}{{ (customsPage - 1) * customsPageSize + idx + 1 }}{% endraw %}</td>
<td><strong>{% raw %}{{ item.customsNo || item.customs_no || item.id || '-' }}{% endraw %}</strong></td>
<td>{% raw %}{{ item.name || item.customsName || item.customs_name || '-' }}{% endraw %}</td>
<td><span class="badge" :class="'badge-' + (item.status || 'unknown')">{% raw %}{{ item.status || '未知' }}{% endraw %}</span></td>
<td>{% raw %}{{ item.machineCount || item.machine_count || item.machineNum || item.machine_num || '?' }}{% endraw %}</td>
<td>
<button class="btn btn-small btn-primary" @click.stop="selectCustomsRow(item, idx)">
📦 查看机器
</button>
</td>
</tr>
<tr v-if="!customsPageData.length && !customsLoading">
<td colspan="6" style="text-align:center;color:#8899aa;padding:24px">暂无报关单数据</td>
</tr>
</tbody>
</table>
</div>
<!-- 分页控件 -->
<div class="pagination" v-if="customsTotal > customsPageSize">
<button class="btn btn-small" :disabled="customsPage <= 1" @click="customsPage = customsPage - 1; loadCustomsList()"> 上一页</button>
<span style="margin:0 12px;color:#9aa0a6;font-size:13px">
第 {% raw %}{{ customsPage }}{% endraw %} / {% raw %}{{ customsTotalPages }}{% endraw %} 页(共 {% raw %}{{ customsTotal }}{% endraw %} 条)
</span>
<button class="btn btn-small" :disabled="customsPage >= customsTotalPages" @click="customsPage = customsPage + 1; loadCustomsList()">下一页 </button>
</div>
</section>
<!-- 机器列表(点击报关单行时展开) -->
<section class="card" v-if="customsMachines.length">
<div style="display:flex;justify-content:space-between;align-items:center">
<h2>📦 机器列表</h2>
<span style="color:#9aa0a6;font-size:13px">报关单: <strong style="color:#e0e0e0">{% raw %}{{ selectedCustomsName }}{% endraw %}</strong></span>
</div>
<p class="hint" style="margin-bottom:12px"><strong>{% raw %}{{ customsMachines.length }}{% endraw %}</strong> 台机器</p>
<div class="table-wrapper">
<table class="data-table">
<thead>
<tr>
<th style="width:50px">序号</th>
<th>机器编号</th>
<th>机器名称</th>
<th>型号</th>
<th>二维码值</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr v-for="(m, mi) in customsMachines" :key="mi">
<td>{% raw %}{{ mi + 1 }}{% endraw %}</td>
<td><strong>{% raw %}{{ m.serialNumber || m.serial_number || m.serialNo || m.serial_no || m.machineNo || m.machine_no || m.id || '-' }}{% endraw %}</strong></td>
<td>{% raw %}{{ m.name || m.machineName || m.machine_name || m.model || '-' }}{% endraw %}</td>
<td>{% raw %}{{ m.modelName || m.model_name || m.model || '-' }}{% endraw %}</td>
<td style="font-family:monospace;color:#4fc3f7">{% raw %}{{ m.qrValue || m.qr_value || m.qr || m.qrCode || m.qr_code || m.serialNumber || m.serial_number || '-' }}{% endraw %}</td>
<td><span class="badge" :class="'badge-' + (m.status || 'normal')">{% raw %}{{ m.status || '正常' }}{% endraw %}</span></td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</main>
<!-- 手动输入二维码弹窗 -->
@@ -621,6 +713,6 @@
</div>
<script src="/static/js/vue3.global.prod.js?v=20260526a"></script>
<script src="/static/js/setting.js?v=20260605a"></script>
<script src="/static/js/setting.js?v=20260612a"></script>
</body>
</html>