抓取生产工单,抓取发料异常

This commit is contained in:
hjq
2026-06-11 17:51:01 +08:00
parent 5b19790037
commit a160d5d48f
12 changed files with 965 additions and 58 deletions

View File

@@ -95,21 +95,30 @@
}
/* 特定卡片的颜色定制 */
.card-receipt:hover { border-color: #67C23A; background-color: #f0f9eb; }
.card-receipt { border-top: 4px solid #67C23A; }
.card-receipt i { color: #67C23A; }
.card-receipt:hover { border-color: #67C23A; background-color: #f0f9eb; }
.card-bom-tree:hover { border-color: #409EFF; background-color: #ecf5ff; }
.card-bom-tree { border-top: 4px solid #409EFF; }
.card-bom-tree i { color: #409EFF; }
.card-bom-tree:hover { border-color: #409EFF; background-color: #ecf5ff; }
.card-bom-compare:hover { border-color: #E6A23C; background-color: #fdf6ec; }
.card-bom-compare i { color: #E6A23C; }
.card-bom-compare { border-top: 4px solid #9c27b0; }
.card-bom-compare i { color: #9c27b0; }
.card-bom-compare:hover { border-color: #9c27b0; background-color: #f3e5f5; }
.card-work-order { border-top: 4px solid #E6A23C; }
.card-work-order i { color: #E6A23C; }
.card-work-order:hover { border-color: #E6A23C; background-color: #fdf6ec; }
.card-abnormal { border-top: 4px solid #F56C6C; }
.card-abnormal i { color: #F56C6C; }
.card-abnormal:hover { border-color: #F56C6C; background-color: #fef0f0; }
.card-reconciliation { border-top: 4px solid #909399; }
.card-reconciliation i { color: #909399; }
.card-reconciliation:hover { border-color: #909399; background-color: #f4f4f5; }
.action-group {
margin-top: 40px;
padding-top: 30px;
@@ -117,6 +126,37 @@
display: flex;
justify-content: center;
gap: 20px;
position: relative;
}
.log-window {
margin-top: 30px;
background-color: #1e1e1e;
color: #a9b7c6;
border-radius: 8px;
padding: 15px;
height: 250px;
overflow-y: auto;
text-align: left;
font-family: 'Consolas', 'Courier New', monospace;
font-size: 13px;
line-height: 1.5;
box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
border: 1px solid #333;
}
.log-window::-webkit-scrollbar {
width: 8px;
}
.log-window::-webkit-scrollbar-track {
background: #1e1e1e;
}
.log-window::-webkit-scrollbar-thumb {
background: #555;
border-radius: 4px;
}
.log-window::-webkit-scrollbar-thumb:hover {
background: #777;
}
</style>
@@ -162,6 +202,13 @@
<h3>发料异常检查</h3>
<p>排查生产工单的发料异常,对比理论出料与实际发放数量的差异。</p>
</div>
<!-- 卡片 6: 绩效核查与BOM比对 -->
<div class="nav-card card-reconciliation" onclick="window.location.href='/reconciliation'">
<i class="el-icon-data-analysis"></i>
<h3>绩效核查与BOM比对</h3>
<p>数据清洗、匹配工单号,智能比对 BOM 理论发料量与实际发料量差异。</p>
</div>
</div>
<div class="action-group">
@@ -198,6 +245,8 @@
</div>
</div>
{% include 'global_log.html' %}
<script>
new Vue({
el: '#app',
@@ -235,7 +284,9 @@
},
syncReceipts() {
this.syncing = true;
if (window.globalLogApp) {
window.globalLogApp.logDialogVisible = true;
}
axios.post('/api/sync_receipts')
.then(res => {
if (res.data.success) {
@@ -258,31 +309,42 @@
});
},
syncBom() {
this.syncingBom = true;
axios.post('/api/sync_bom')
.then(res => {
if (res.data.success) {
this.$message.success('已触发!' + res.data.message);
setTimeout(this.checkTaskStatus, 500);
} else {
this.$message.error('触发失败:' + res.data.message);
}
})
.catch(err => {
if (err.response && err.response.status === 409) {
this.$message.warning(err.response.data.message);
} else {
this.$message.error('请求发生异常,请检查后端日志。');
}
})
.finally(() => {
this.syncingBom = false;
});
this.$confirm('此操作将启动后台浏览器耗时较长约10-20分钟期间请勿关闭服务器终端。确认执行?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.syncingBom = true;
// 如果存在全局日志组件,自动打开日志面板
if (window.globalLogApp) {
window.globalLogApp.logDialogVisible = true;
}
axios.post('/api/sync_bom')
.then(res => {
if (res.data.success) {
this.$message.success('已触发!' + res.data.message);
setTimeout(this.checkTaskStatus, 500);
} else {
this.$message.error('触发失败:' + res.data.message);
}
})
.catch(err => {
if (err.response && err.response.status === 409) {
this.$message.warning(err.response.data.message);
} else {
this.$message.error('请求发生异常,请检查后端日志。');
}
})
.finally(() => {
this.syncingBom = false;
});
}).catch(() => {});
},
syncWorkOrders() {
this.syncingWorkOrders = true;
if (window.globalLogApp) {
window.globalLogApp.logDialogVisible = true;
}
axios.post('/api/sync_work_orders')
.then(res => {
if (res.data.success) {