|
|
|
|
@ -18,16 +18,16 @@
|
|
|
|
|
<el-table-column label='工单号' prop='planCode' width='150' align='center' />
|
|
|
|
|
<el-table-column label='产品名称' prop='materialName' width='200' align='center' show-overflow-tooltip />
|
|
|
|
|
<el-table-column label='工序名称' prop='processName' width='150' align='center' />
|
|
|
|
|
<el-table-column label='工位' prop='workstation' width='120' align='center' />
|
|
|
|
|
<el-table-column label='报工数量' prop='reportQuantity' width='100' align='center' />
|
|
|
|
|
<el-table-column label='不良数量' prop='defectiveQuantity' width='100' align='center' />
|
|
|
|
|
<el-table-column label='不良数量' prop='remainingAmount' width='100' align='center' />
|
|
|
|
|
<el-table-column label='报工时间' prop='reportTime' width='180' align='center'>
|
|
|
|
|
<template #default='scope'>
|
|
|
|
|
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label='报工人' prop='reportUser' width='120' align='center' />
|
|
|
|
|
<el-table-column label='工位' prop='workstation' width='120' align='center' />
|
|
|
|
|
<el-table-column label='备注' prop='remark' align='center' show-overflow-tooltip />
|
|
|
|
|
<!-- <el-table-column label='备注' prop='remark' align='center' show-overflow-tooltip />-->
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
@ -43,8 +43,10 @@
|
|
|
|
|
|
|
|
|
|
<script setup name='WorkReportRecord' lang='ts'>
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
import { listProductPlanDetail } from '@/api/mes/productPlanDetail';
|
|
|
|
|
import { ProductPlanDetailVO, ProductPlanDetailQuery } from '@/api/mes/productPlanDetail/types';
|
|
|
|
|
import { listPlanInfo } from '@/api/mes/planInfo';
|
|
|
|
|
import { PlanInfoVO, PlanInfoQuery } from '@/api/mes/planInfo/types';
|
|
|
|
|
import { PlanInfoQuery } from '@/api/mes/planInfo/types';
|
|
|
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
@ -55,44 +57,43 @@ const loading = ref(false);
|
|
|
|
|
const recordList = ref<any[]>([]);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
|
|
|
|
|
const queryParams = ref<PlanInfoQuery>({
|
|
|
|
|
const queryParams = ref<ProductPlanDetailQuery>({
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
planStatus: '2,3' // 已开始或已完成
|
|
|
|
|
pageSize: 10
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 获取报工记录列表
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
try {
|
|
|
|
|
const query: PlanInfoQuery = {
|
|
|
|
|
...queryParams.value,
|
|
|
|
|
releaseType: '3' // 工位类型
|
|
|
|
|
// 查询生产信息
|
|
|
|
|
let allDetailList: ProductPlanDetailVO[] = [];
|
|
|
|
|
|
|
|
|
|
// 如果没有工位ID,直接查询所有生产信息
|
|
|
|
|
const query: ProductPlanDetailQuery = {
|
|
|
|
|
...queryParams.value
|
|
|
|
|
};
|
|
|
|
|
// 如果有工位ID,添加到查询参数中
|
|
|
|
|
if (props.workstationId) {
|
|
|
|
|
query.releaseId = props.workstationId;
|
|
|
|
|
}
|
|
|
|
|
// 这里应该调用专门的报工记录接口,暂时使用工单列表接口
|
|
|
|
|
// 实际应该调用类似 /mes/prodReport/workReportRecord 的接口
|
|
|
|
|
const res = await listPlanInfo(query);
|
|
|
|
|
|
|
|
|
|
// 模拟报工记录数据(实际应该从后端获取)
|
|
|
|
|
recordList.value = (res.rows || []).map((item: PlanInfoVO) => ({
|
|
|
|
|
const res = await listProductPlanDetail(query);
|
|
|
|
|
allDetailList = res.rows || [];
|
|
|
|
|
|
|
|
|
|
// 映射生产信息数据到报工记录显示格式
|
|
|
|
|
recordList.value = allDetailList.map((item: ProductPlanDetailVO) => ({
|
|
|
|
|
planCode: item.planCode,
|
|
|
|
|
materialName: item.materialName,
|
|
|
|
|
processName: item.processName,
|
|
|
|
|
materialName: (item as any).materialName || '-',
|
|
|
|
|
processName: (item as any).processName || '-',
|
|
|
|
|
reportQuantity: item.completeAmount || 0,
|
|
|
|
|
defectiveQuantity: 0, // 需要从报工记录表获取
|
|
|
|
|
reportTime: item.realBeginTime || item.planBeginTime,
|
|
|
|
|
reportUser: '操作员', // 需要从报工记录表获取
|
|
|
|
|
workstation: '-', // 工位信息可以从工单数据中获取
|
|
|
|
|
remainingAmount: (item as any).remainingAmount || 0,
|
|
|
|
|
reportTime: item.realBeginTime || item.realEndTime || '',
|
|
|
|
|
reportUser: item.userName || '-',
|
|
|
|
|
workstation: (item as any).workstationName || '-',
|
|
|
|
|
remark: item.remark || '-'
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
total.value = res.total || 0;
|
|
|
|
|
|
|
|
|
|
total.value = allDetailList.length;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取报工记录失败:', error);
|
|
|
|
|
recordList.value = [];
|
|
|
|
|
total.value = 0;
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
|