update 报工页面优化加首检、报工记录

master
yinq 3 weeks ago
parent ba5ae524ee
commit b1fdab7498

@ -119,6 +119,15 @@ export function orderAddProductPlanList(data) {
})
}
// 机加生产工单新增生产派工List
export function orderAddProductPlanJJList(data) {
return request({
url: '/mes/planInfo/orderAddProductPlanJJList',
method: 'post',
data: data
})
}
/**
*
* @param planId
@ -168,3 +177,65 @@ export const materialBomVersionSelect = (query?: MaterialBomQuery): AxiosPromise
});
};
/**
*
* @param planId ID
* @returns {*}
*/
export const startPlanInfo = (planId: string | number) => {
return request({
url: '/mes/planInfo/start/' + planId,
method: 'put'
});
};
/**
*
* @param planId ID
* @returns {*}
*/
export const stopPlanInfo = (planId: string | number) => {
return request({
url: '/mes/planInfo/stop/' + planId,
method: 'put'
});
};
/**
*
* @param planId ID
* @returns {*}
*/
export const resumePlanInfo = (planId: string | number) => {
return request({
url: '/mes/planInfo/resume/' + planId,
method: 'put'
});
};
/**
*
* @param data planIdreportQuantitydefectiveQuantity
* @returns {*}
*/
export const reportPlanInfo = (data: any) => {
return request({
url: '/mes/planInfo/report',
method: 'post',
data: data
});
};
/**
*
* @param data planId
* @returns {*}
*/
export const generateInspectionTask = (data: any) => {
return request({
url: '/qms/qcMobile/generateInspectionTask',
method: 'post',
data: data
});
};

@ -113,9 +113,9 @@
<el-button
type='primary'
:disabled='!currentWorkOrder'
@click='handleSelfInspection'
@click='handleFirstInspection'
>
</el-button>
</div>
</div>
@ -123,8 +123,10 @@
<script setup name='CurrentTask' lang='ts'>
import { ref, computed, onMounted, getCurrentInstance } from 'vue';
import { listPlanInfo, updatePlanInfo, stopPlanInfo, resumePlanInfo, reportPlanInfo } from '@/api/mes/planInfo';
import { listPlanInfo, updatePlanInfo, stopPlanInfo, resumePlanInfo, reportPlanInfo, generateInspectionTask } from '@/api/mes/planInfo';
import { PlanInfoVO, PlanInfoQuery } from '@/api/mes/planInfo/types';
import { getProdProductPlanDetailList, listProductPlanDetail } from '@/api/mes/productPlanDetail';
import { ProductPlanDetailQuery } from '@/api/mes/productPlanDetail/types';
import { parseTime } from '@/utils/ruoyi';
const { proxy } = getCurrentInstance() as any;
@ -312,9 +314,42 @@ const handleReportWork = async () => {
}
};
//
const handleSelfInspection = () => {
proxy?.$modal.msgInfo('自检功能待开发');
//
const handleFirstInspection = async () => {
if (!currentWorkOrder.value) return;
try {
await proxy?.$modal.confirm('确认生成首检任务?');
loading.value = true;
const detailRes = await getProdProductPlanDetailList({ planId: currentWorkOrder.value.planId });
const detailList = detailRes.data || [];
//
if (!detailList || detailList.length === 0) {
proxy?.$modal.msgWarning('本工单尚未生成生产信息,无法进行首检');
return;
}
const firstDetail = detailList[detailList.length - 1];
const planDetailId = firstDetail.planDetailId;
//
const inspectionData = {
planDetailId: planDetailId,
processId: currentWorkOrder.value.processId,
qcInspectionType: '0' // 0 1 2 3 4 5 6 7
};
await generateInspectionTask(inspectionData);
proxy?.$modal.msgSuccess('首检任务生成成功');
} catch (error: any) {
if (error !== 'cancel') {
proxy?.$modal.msgError('首检任务生成失败');
console.error('首检任务生成失败:', error);
}
} finally {
loading.value = false;
}
};
//

@ -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;
}

@ -14,7 +14,6 @@
<el-select
v-model='workstationId'
placeholder='请选择或搜索工位'
style='width: 200px; margin-left: 8px;'
:disabled='activeTab !== "pending"'
filterable
clearable

Loading…
Cancel
Save