feat: 大屏多订单改为同屏并列展示,物料申请新增跨工位借料来源并移除工单完成日期
This commit is contained in:
@@ -41,6 +41,13 @@ const recPage = reactive({ current: 1, size: 10 })
|
||||
|
||||
function snOf(row) { return (row.details || []).map(d => d.snCode).filter(Boolean).join(',') }
|
||||
|
||||
// 借料来源展示(出库单 borrow_from 已排除本工位自取,直接展示借出的兄弟工位)
|
||||
function borrowText(row) {
|
||||
const b = row.borrowFrom || {}
|
||||
const parts = Object.entries(b).filter(([, v]) => Number(v) > 0).map(([k, v]) => `工位${k} ${v}个`)
|
||||
return parts.length ? parts.join('、') : ''
|
||||
}
|
||||
|
||||
async function loadRecords() {
|
||||
loadingRec.value = true
|
||||
try {
|
||||
@@ -84,6 +91,12 @@ function downloadCSV() {
|
||||
.then((name) => { if (name) ElMessage.success('已导出:' + name) })
|
||||
.catch(() => ElMessage.error('导出失败'))
|
||||
}
|
||||
// 出库单详情 + 打印(收口借料知情权:库房租户实物凭证须可见借料来源)
|
||||
const detailRow = ref(null)
|
||||
const detailVisible = ref(false)
|
||||
function openDetail(row) { detailRow.value = row; detailVisible.value = true }
|
||||
function doPrint() { window.print() }
|
||||
|
||||
onMounted(loadRecords)
|
||||
</script>
|
||||
|
||||
@@ -175,6 +188,12 @@ onMounted(loadRecords)
|
||||
<el-table-column prop="targetStation" label="目标工位" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.targetStation || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借料来源" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<span v-if="borrowText(row)" style="color:#e6a23c">{{ borrowText(row) }}</span>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boxNo" label="箱号" min-width="120">
|
||||
<template #default="{ row }">{{ row.boxNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
@@ -185,6 +204,11 @@ onMounted(loadRecords)
|
||||
<el-table-column label="时间" width="150" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openDetail(row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, sizes, prev, pager, next" :total="recTotal"
|
||||
@@ -193,9 +217,47 @@ onMounted(loadRecords)
|
||||
@size-change="(s) => { recPage.size = s; recPage.current = 1; loadRecords() }" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="detailVisible" title="出库单详情" width="560px" append-to-body destroy-on-close>
|
||||
<div id="ob-print-area" class="ob-print" v-if="detailRow">
|
||||
<div class="ob-print-head">出库单 · {{ detailRow.outboundNo }}</div>
|
||||
<el-descriptions :column="1" border size="small">
|
||||
<el-descriptions-item label="出库单号">{{ detailRow.outboundNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="类型">{{ typeLabel(detailRow.outboundType) }}</el-descriptions-item>
|
||||
<el-descriptions-item v-if="detailRow.outboundType === 'general' || detailRow.outboundType === 'project'" label="出库类别">{{ categoryLabel(detailRow.outboundCategory) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物料">{{ detailRow.materialCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数量">{{ detailRow.quantity }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目标工位">{{ detailRow.targetStation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="目标接驳台">{{ detailRow.targetDock || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="箱号">{{ detailRow.boxNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="SN">{{ detailRow.snCodes || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="操作人">{{ detailRow.operator }}</el-descriptions-item>
|
||||
<el-descriptions-item label="时间">{{ fmtTime(detailRow.createdAt) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ detailRow.remark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="借料来源">
|
||||
<span v-if="borrowText(detailRow)" style="color:#e6a23c;font-weight:600">{{ borrowText(detailRow) }}</span>
|
||||
<span v-else style="color:#909399">—(本工位自取,无借料)</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="detailVisible = false">关闭</el-button>
|
||||
<el-button type="primary" @click="doPrint">打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mb12 { margin-bottom: 12px; }
|
||||
.pager { display: flex; justify-content: flex-end; margin-top: 10px; }
|
||||
.ob-print-head { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 10px; }
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* 打印出库单:仅显示详情区,隐藏应用框架(含借料来源) */
|
||||
@media print {
|
||||
body * { visibility: hidden !important; }
|
||||
#ob-print-area, #ob-print-area * { visibility: visible !important; }
|
||||
#ob-print-area { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -82,7 +82,7 @@ let alertInited = false
|
||||
|
||||
async function pollAlerts() {
|
||||
try {
|
||||
const data = await request.get('/api/alerts', { params: { status: 'unread', pageSize: 1 } })
|
||||
const data = await request.get('/alerts', { params: { status: 'unread', pageSize: 1 } })
|
||||
const n = (data && data.unreadCount) || 0
|
||||
// 首轮仅初始化角标;之后未读数增加时弹提示,避免反复骚扰
|
||||
if (alertInited && n > unreadAlerts.value) {
|
||||
@@ -142,6 +142,7 @@ const menuGroups = [
|
||||
{ path: '/attachment', title: '附件中心', icon: Folder, code: 'attachment:view' },
|
||||
{ path: '/data-archive', title: '数据归档', icon: Tools, code: 'backup:manage' },
|
||||
{ path: '/alert-center', title: '预警中心', icon: Bell },
|
||||
{ path: '/alert-rule', title: '预警规则', icon: Bell },
|
||||
{ path: '/settings', title: '基础设置', icon: Setting, code: 'sys.settings:view' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -64,33 +64,7 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 规则配置 -->
|
||||
<el-card style="margin-top:14px">
|
||||
<template #header>预警规则配置</template>
|
||||
<el-table :data="rules" border size="small" v-loading="rulesLoading" empty-text="暂无规则">
|
||||
<el-table-column prop="code" label="规则编码" width="180" />
|
||||
<el-table-column prop="name" label="规则名称" min-width="160" />
|
||||
<el-table-column label="启用" width="90" align="center">
|
||||
<template #default="{row}">
|
||||
<el-switch v-model="row.enabled" @change="saveRule(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="阈值" width="200">
|
||||
<template #default="{row}">
|
||||
<el-input-number v-model="row.threshold" :min="0" :controls="false" style="width:120px" @change="saveRule(row)" />
|
||||
<span class="unit">{{ thresholdUnit(row.code) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" min-width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.remark" size="small" placeholder="可填写备注" @change="saveRule(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top:8px;color:#999;font-size:12px">
|
||||
说明:阈值仅对「来料检超期未检」(超期小时) 与「库龄超档」(超期天) 生效;其余规则阈值不参与判定。
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 规则配置已迁独立「预警规则」菜单(2026-11-02 条目15:与 MES 预警中心/预警规则双菜单结构统一) -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -104,7 +78,8 @@ const ruleMeta = {
|
||||
inspection_overdue: '来料检超期未检',
|
||||
backup_overdue: '备份超期',
|
||||
sync_failed: '物料同步失败',
|
||||
inventory_age: '库龄超档'
|
||||
inventory_age: '库龄超档',
|
||||
negative_stock: '库存负数异常'
|
||||
}
|
||||
const levelMeta = { info: '信息', warning: '警告', error: '严重' }
|
||||
function levelTag(l) {
|
||||
@@ -112,11 +87,6 @@ function levelTag(l) {
|
||||
if (l === 'warning') return 'warning'
|
||||
return 'info'
|
||||
}
|
||||
function thresholdUnit(code) {
|
||||
if (code === 'inspection_overdue') return '小时'
|
||||
if (code === 'inventory_age') return '天'
|
||||
return '(未使用)'
|
||||
}
|
||||
|
||||
const list = ref([])
|
||||
const total = ref(0)
|
||||
@@ -127,9 +97,6 @@ const pageSize = ref(20)
|
||||
|
||||
const filters = reactive({ status: '', ruleCode: '' })
|
||||
|
||||
const rules = ref([])
|
||||
const rulesLoading = ref(false)
|
||||
|
||||
function fmtTime(t) {
|
||||
if (!t) return '-'
|
||||
const d = new Date(t * 1000)
|
||||
@@ -147,7 +114,7 @@ async function load() {
|
||||
status: filters.status || undefined,
|
||||
ruleCode: filters.ruleCode || undefined
|
||||
}
|
||||
const data = await request.get('/api/alerts', { params })
|
||||
const data = await request.get('/alerts', { params })
|
||||
list.value = (data && data.list) || []
|
||||
total.value = (data && data.total) || 0
|
||||
} catch (e) {
|
||||
@@ -180,7 +147,7 @@ async function resolve(row) {
|
||||
}
|
||||
row._resolving = true
|
||||
try {
|
||||
await request.post(`/api/alerts/${row.id}/read`)
|
||||
await request.post(`/alerts/${row.id}/read`)
|
||||
ElMessage.success('已标记已读')
|
||||
load()
|
||||
} catch (e) {
|
||||
@@ -199,7 +166,7 @@ async function readAll() {
|
||||
}
|
||||
readAllLoading.value = true
|
||||
try {
|
||||
await request.post('/api/alerts/read-all')
|
||||
await request.post('/alerts/read-all')
|
||||
ElMessage.success('已全部标记为已读')
|
||||
load()
|
||||
} catch (e) {
|
||||
@@ -209,38 +176,8 @@ async function readAll() {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadRules() {
|
||||
rulesLoading.value = true
|
||||
try {
|
||||
const data = await request.get('/api/alert-rules')
|
||||
rules.value = (data || []).map((r) => ({ ...r, enabled: !!r.enabled }))
|
||||
} catch (e) {
|
||||
ElMessage.error(e?.message || '加载规则失败')
|
||||
} finally {
|
||||
rulesLoading.value = false
|
||||
}
|
||||
}
|
||||
let saveTimer = null
|
||||
function saveRule(row) {
|
||||
clearTimeout(saveTimer)
|
||||
saveTimer = setTimeout(async () => {
|
||||
try {
|
||||
await request.post('/api/alert-rules/update', {
|
||||
code: row.code,
|
||||
enabled: row.enabled,
|
||||
threshold: row.threshold,
|
||||
remark: row.remark
|
||||
})
|
||||
ElMessage.success('规则已保存')
|
||||
} catch (e) {
|
||||
ElMessage.error(e?.message || '保存失败')
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
load()
|
||||
loadRules()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<div style="margin-bottom:12px;color:#888;font-size:13px">
|
||||
预警规则:系统内置规则的启用/阈值配置(种子数据,缺则自动补齐)。开关与阈值实时生效(下一轮扫描即用新值,约 5 分钟内)。
|
||||
预警消息统一在「预警中心」查看与闭环。
|
||||
</div>
|
||||
<el-table :data="rules" border size="small" v-loading="rulesLoading" empty-text="暂无规则">
|
||||
<el-table-column prop="code" label="规则编码" width="200" />
|
||||
<el-table-column prop="name" label="规则名称" min-width="180" />
|
||||
<el-table-column label="启用" width="90" align="center">
|
||||
<template #default="{row}">
|
||||
<el-switch v-model="row.enabled" @change="saveRule(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="阈值" width="200">
|
||||
<template #default="{row}">
|
||||
<el-input-number v-model="row.threshold" :min="0" :controls="false" style="width:120px" @change="saveRule(row)" />
|
||||
<span class="unit">{{ thresholdUnit(row.code) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="说明" min-width="240">
|
||||
<template #default="{row}">{{ ruleNote(row.code) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" min-width="160">
|
||||
<template #default="{row}">
|
||||
<el-input v-model="row.remark" size="small" placeholder="可填写备注" @change="saveRule(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top:8px;color:#999;font-size:12px">
|
||||
说明:阈值仅对「来料检超期未检」(超期小时) 与「库龄超档」(超期天) 生效;其余规则阈值不参与判定。
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import request from '../utils/request'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const ruleNotes = {
|
||||
inventory_low: '物料合格可用量低于其安全库存即预警(安全库存在「物料档案」维护)',
|
||||
inspection_overdue: '来料检验单超过阈值小时仍未检验即预警',
|
||||
backup_overdue: '距上次成功备份超过提醒周期即预警(周期在「基础设置」配置)',
|
||||
sync_failed: '物料推送 MES 失败即预警,请手动重试同步',
|
||||
inventory_age: '库存行入库超过阈值天(默认 180 天)即预警',
|
||||
negative_stock: '库存行数量为负数(数据异常)即预警,需核对出入库流水并盘点纠正'
|
||||
}
|
||||
function ruleNote(code) {
|
||||
return ruleNotes[code] || ''
|
||||
}
|
||||
function thresholdUnit(code) {
|
||||
if (code === 'inspection_overdue') return '小时'
|
||||
if (code === 'inventory_age') return '天'
|
||||
return '(未使用)'
|
||||
}
|
||||
|
||||
const rules = ref([])
|
||||
const rulesLoading = ref(false)
|
||||
|
||||
async function loadRules() {
|
||||
rulesLoading.value = true
|
||||
try {
|
||||
const data = await request.get('/alert-rules')
|
||||
rules.value = (data || []).map((r) => ({ ...r, enabled: !!r.enabled }))
|
||||
} catch (e) {
|
||||
ElMessage.error(e?.message || '加载规则失败')
|
||||
} finally {
|
||||
rulesLoading.value = false
|
||||
}
|
||||
}
|
||||
let saveTimer = null
|
||||
function saveRule(row) {
|
||||
clearTimeout(saveTimer)
|
||||
saveTimer = setTimeout(async () => {
|
||||
try {
|
||||
await request.post('/alert-rules/update', {
|
||||
code: row.code,
|
||||
enabled: row.enabled,
|
||||
threshold: row.threshold,
|
||||
remark: row.remark
|
||||
})
|
||||
ElMessage.success('规则已保存')
|
||||
} catch (e) {
|
||||
ElMessage.error(e?.message || '保存失败')
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
|
||||
onMounted(loadRules)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.unit { margin-left: 8px; color: #909399; font-size: 12px; }
|
||||
</style>
|
||||
@@ -792,7 +792,12 @@ async function onMaterialFile(e) {
|
||||
<el-table-column label="状态" width="80" align="center"><template #default="{ row }"><el-tag :type="row.status === '停用' ? 'warning' : 'success'" size="small">{{ row.status || '启用' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="备注" min-width="130" show-overflow-tooltip><template #default="{ row }">{{ row.description || '-' }}</template></el-table-column>
|
||||
<el-table-column label="创建时间" width="155" align="center"><template #default="{ row }">{{ fmtTime(row.createdAt) }}</template></el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="90" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="can('zone:edit') && !row.isSynthetic" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button>
|
||||
<span v-else-if="row.isSynthetic" class="synthetic-tag">虚拟</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, sizes, prev, pager, next" :total="nodeState[3].total"
|
||||
@@ -849,7 +854,12 @@ async function onMaterialFile(e) {
|
||||
<el-table-column label="状态" width="80" align="center"><template #default="{ row }"><el-tag :type="row.status === '停用' ? 'warning' : 'success'" size="small">{{ row.status || '启用' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="备注" min-width="120" show-overflow-tooltip><template #default="{ row }">{{ row.description || '-' }}</template></el-table-column>
|
||||
<el-table-column label="创建时间" width="155" align="center"><template #default="{ row }">{{ fmtTime(row.createdAt) }}</template></el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="90" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="can('zone:edit') && !row.isSynthetic" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button>
|
||||
<span v-else-if="row.isSynthetic" class="synthetic-tag">虚拟</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, sizes, prev, pager, next" :total="nodeState[4].total"
|
||||
|
||||
@@ -42,6 +42,12 @@
|
||||
<el-tag v-else type="info" size="small">工位叫料</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借料来源" min-width="180" align="center">
|
||||
<template #default="{row}">
|
||||
<span v-if="borrowText(row)" style="color:#e6a23c">{{ borrowText(row) }}</span>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="130" align="center" fixed="right">
|
||||
<template #default="{row}">
|
||||
<el-button
|
||||
@@ -91,6 +97,16 @@ const completingNo = ref('')
|
||||
const rejectingNo = ref('')
|
||||
const rejectDlg = reactive({ visible: false, row: null, reason: '' })
|
||||
|
||||
// 借料来源展示:排除本工位自取项(borrowFrom 含本工位 stationNo),仅显示真正借出的兄弟工位
|
||||
function borrowText(row) {
|
||||
const b = row.borrowFrom || {}
|
||||
const self = String(row.stationNo)
|
||||
const parts = Object.entries(b)
|
||||
.filter(([k, v]) => Number(v) > 0 && String(k) !== self)
|
||||
.map(([k, v]) => `工位${k} ${v}个`)
|
||||
return parts.length ? '含借:' + parts.join('、') : ''
|
||||
}
|
||||
|
||||
function resetFilters() {
|
||||
Object.assign(query, { stationNo: '', materialCode: '', requestNo: '' })
|
||||
load()
|
||||
|
||||
@@ -49,12 +49,19 @@
|
||||
<el-input v-model="form.displayAgeBuckets" clearable placeholder="如 30,90,180(默认)" />
|
||||
<div class="tip">逗号分隔的 3 个升序天数,对应大屏库龄柱状图四档:0-a / a-b / b-c / c 以上;改后即时生效</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="MES 服务地址">
|
||||
<div style="display:flex;gap:8px;width:100%">
|
||||
<el-input v-model="form.mesBaseURL" clearable placeholder="http://127.0.0.1:8888(留空=用配置文件默认)" style="flex:1" />
|
||||
<el-button :loading="pinging" @click="testMes">测试连接</el-button>
|
||||
</div>
|
||||
<div class="tip">MES 后端地址(含端口,如 http://192.168.1.50:8888)。保存即生效、无需重启;留空则回退配置文件默认地址</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="can('sys.settings:edit')" type="primary" :loading="saving" @click="save">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card shadow="never" header="本机信息(只读)" style="margin-top:12px">
|
||||
<el-card shadow="never" header="本机基础信息(只读)" style="margin-top:12px">
|
||||
<el-descriptions :column="2" border size="small" v-loading="loadingInfo">
|
||||
<el-descriptions-item label="操作系统">{{ info.os || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主机名">{{ info.hostname || '-' }}</el-descriptions-item>
|
||||
@@ -62,9 +69,9 @@
|
||||
<el-descriptions-item label="监听端口">{{ info.port || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="启动时间">{{ info.startTime ? fmtTime(info.startTime) : '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="运行时长">{{ uptimeText }}</el-descriptions-item>
|
||||
<el-descriptions-item label="MES 地址" :span="2">
|
||||
<el-descriptions-item label="当前生效 MES 地址" :span="2">
|
||||
{{ info.mesAddress || '-' }}
|
||||
<span class="tip" style="margin-left:8px">只读;修改需编辑配置文件并重启服务</span>
|
||||
<span class="tip" style="margin-left:8px">在上方「MES 服务地址」修改,保存即生效</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
@@ -90,7 +97,8 @@ const form = reactive({
|
||||
displayStockCorner: '库房监控',
|
||||
displayStockRefresh: 5,
|
||||
displayCallsRefresh: 10,
|
||||
displayAgeBuckets: '30,90,180'
|
||||
displayAgeBuckets: '30,90,180',
|
||||
mesBaseURL: ''
|
||||
})
|
||||
|
||||
async function load() {
|
||||
@@ -107,6 +115,7 @@ async function load() {
|
||||
form.displayStockRefresh = d.displayStockRefresh ?? 5
|
||||
form.displayCallsRefresh = d.displayCallsRefresh ?? 10
|
||||
form.displayAgeBuckets = d.displayAgeBuckets || '30,90,180'
|
||||
form.mesBaseURL = d.mesBaseURL || ''
|
||||
} catch { /* 默认值兜底 */ }
|
||||
finally { loading.value = false }
|
||||
}
|
||||
@@ -116,9 +125,26 @@ async function save() {
|
||||
try {
|
||||
await request.put('/settings', { ...form })
|
||||
ElMessage.success('已保存并生效')
|
||||
loadInfo()
|
||||
} finally { saving.value = false }
|
||||
}
|
||||
|
||||
// MES 连通性测试(用当前输入值先落库再测,避免"测试的是旧地址")
|
||||
const pinging = ref(false)
|
||||
async function testMes() {
|
||||
pinging.value = true
|
||||
try {
|
||||
await request.put('/settings', { ...form })
|
||||
await request.get('/system/mes-ping')
|
||||
ElMessage.success('MES 连接正常')
|
||||
} catch {
|
||||
// 拦截器已提示失败原因
|
||||
} finally {
|
||||
pinging.value = false
|
||||
loadInfo()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
|
||||
// 本机只读信息
|
||||
|
||||
@@ -31,7 +31,8 @@ const routes = [
|
||||
{ path: 'attachment', name: 'AttachmentCenter', component: () => import('../pages/AttachmentCenter.vue'), meta: { title: '附件中心', keepAlive: true, componentName: 'AttachmentCenter' } },
|
||||
{ path: 'data-archive', name: 'DataArchive', component: () => import('../pages/DataArchive.vue'), meta: { title: '数据归档', keepAlive: true, componentName: 'DataArchive' } },
|
||||
{ path: 'settings', name: 'Settings', component: () => import('../pages/Settings.vue'), meta: { title: '基础设置', keepAlive: true, componentName: 'Settings' } },
|
||||
{ path: 'alert-center', name: 'AlertCenter', component: () => import('../pages/AlertCenter.vue'), meta: { title: '预警中心', keepAlive: true, componentName: 'AlertCenter' } }
|
||||
{ path: 'alert-center', name: 'AlertCenter', component: () => import('../pages/AlertCenter.vue'), meta: { title: '预警中心', keepAlive: true, componentName: 'AlertCenter' } },
|
||||
{ path: 'alert-rule', name: 'AlertRule', component: () => import('../pages/AlertRule.vue'), meta: { title: '预警规则', keepAlive: true, componentName: 'AlertRule' } }
|
||||
]
|
||||
},
|
||||
{ path: '/:pathMatch(.*)*', redirect: '/' }
|
||||
|
||||
Reference in New Issue
Block a user