feat(mes,wms): 新增设备送检审批流程及相关功能

1. 新增设备送检审批的API接口层
2. 在待办页面添加设备送检审批标签页
3. 完善设备巡检日报的送检提交功能
4. 修复报表模板查询的参数传递问题
5. 优化设备送检审批单的业务逻辑处理
This commit is contained in:
2026-05-29 17:05:23 +08:00
parent d6099a781f
commit aad568f320
6 changed files with 340 additions and 11 deletions

View File

@@ -15,6 +15,9 @@
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
</el-form-item>
<el-form-item v-hasPermi="['mes:eqp:submit']">
<el-button type="success" icon="el-icon-s-promotion" @click="handleSubmitForApproval">送检</el-button>
</el-form-item>
</el-form>
</el-row>
@@ -107,17 +110,25 @@
import { listEquipmentPart } from "@/api/mes/eqp/equipmentPart";
import { listEquipmentInspectionRecord } from "@/api/mes/eqp/equipmentInspectionRecord";
import { listProductionLine } from "@/api/wms/productionLine";
import { addEquipmentInspectionApproval } from "@/api/mes/eqp/equipmentInspectionApproval";
export default {
name: "DailyInspectionReport",
data() {
const d = new Date();
const today = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
const routeQuery = this.$route && this.$route.query || {};
const hasRouteQuery = !!(routeQuery.productionLine || (routeQuery.startDate && routeQuery.endDate));
return {
loading: false,
dateRange: [this.getToday(), this.getToday()],
productionLine: 2,
dateRange: (routeQuery.startDate && routeQuery.endDate)
? [routeQuery.startDate, routeQuery.endDate]
: [today, today],
productionLine: routeQuery.productionLine ? Number(routeQuery.productionLine) : 2,
lineList: [],
partList: [],
records: [],
hasRouteQuery,
};
},
computed: {
@@ -253,11 +264,34 @@ export default {
this.loading = false;
}
},
handleSubmitForApproval() {
if (!this.dateRange || this.dateRange.length !== 2) {
this.$modal.msgWarning("请选择时间段");
return;
}
if (!this.productionLine) {
this.$modal.msgWarning("请选择产线");
return;
}
this.$modal.confirm('确认将该时间段"' + this.dateRange[0] + '至' + this.dateRange[1] + '"的巡检日报提交审批吗?').then(() => {
this.loading = true;
return addEquipmentInspectionApproval({
productionLine: this.productionLine,
insStartTime: this.dateRange[0] + ' 00:00:00',
insEndTime: this.dateRange[1] + ' 23:59:59',
});
}).then(() => {
this.$modal.msgSuccess("送检成功");
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
async loadLineList() {
try {
const res = await listProductionLine({ pageSize: 999 });
if (res.rows) this.lineList = res.rows;
if (this.lineList.length > 0) {
if (!this.hasRouteQuery && this.lineList.length > 0) {
const suanYa = this.lineList.find(l => l.lineName === '酸轧线');
this.productionLine = suanYa ? suanYa.lineId : this.lineList[0].lineId;
}