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

This commit is contained in:
hjq
2026-06-11 15:58:56 +08:00
parent 66eecd0daa
commit 5b19790037
40 changed files with 4942 additions and 54 deletions

View File

@@ -104,6 +104,12 @@
.card-bom-compare:hover { border-color: #E6A23C; background-color: #fdf6ec; }
.card-bom-compare i { color: #E6A23C; }
.card-work-order { border-top: 4px solid #E6A23C; }
.card-work-order i { color: #E6A23C; }
.card-abnormal { border-top: 4px solid #F56C6C; }
.card-abnormal i { color: #F56C6C; }
.action-group {
margin-top: 40px;
padding-top: 30px;
@@ -142,6 +148,20 @@
<h3>期间成本对比分析表</h3>
<p>跨时间段核算 BOM 最新价差异,支持虚拟件过滤与历史价回溯。</p>
</div>
<!-- 卡片 4: 生产工单明细 -->
<div class="nav-card card-work-order" onclick="window.location.href='/work_orders'">
<i class="el-icon-document"></i>
<h3>生产工单明细</h3>
<p>查询生产工单记录、领料情况及执行状态。</p>
</div>
<!-- 卡片 5: 发料异常检查 -->
<div class="nav-card card-abnormal" onclick="window.location.href='/abnormal_report'">
<i class="el-icon-warning-outline"></i>
<h3>发料异常检查</h3>
<p>排查生产工单的发料异常,对比理论出料与实际发放数量的差异。</p>
</div>
</div>
<div class="action-group">
@@ -166,6 +186,15 @@
round>
<span v-text="syncingBom ? '请求已发送...' : '读取最新 BOM 表'"></span>
</el-button>
<el-button
type="warning"
:icon="isSystemBusy ? 'el-icon-loading' : 'el-icon-refresh'"
:disabled="isSystemBusy"
@click="syncWorkOrders"
round>
<span v-text="syncingWorkOrders ? '请求已发送...' : '读取生产工单明细'"></span>
</el-button>
</div>
</div>
@@ -176,6 +205,7 @@
return {
syncing: false,
syncingBom: false,
syncingWorkOrders: false,
isSystemBusy: false,
globalTaskName: "",
statusTimer: null
@@ -249,6 +279,29 @@
.finally(() => {
this.syncingBom = false;
});
},
syncWorkOrders() {
this.syncingWorkOrders = true;
axios.post('/api/sync_work_orders')
.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.syncingWorkOrders = false;
});
}
}
});