| | |
| | | |
| | | /** 按工单/工作站分页查询参数记录 */ |
| | | export function getWorkOrderParamRecordPage( |
| | | params: PageParam & { workOrderId?: number; workstationId?: number; recordNo?: string; templateName?: string; createTime?: string[] }, |
| | | params: PageParam & { taskId?: number; workstationId?: number; recordNo?: string; templateName?: string; createTime?: string[] }, |
| | | ) { |
| | | return requestClient.get<PageResult<MesProWorkOrderParamRecordApi.WorkOrderParamRecord>>( |
| | | '/mes/pro/work-order-param-record/page-by-work-order', |
| | |
| | | width: 160, |
| | | slots: { default: 'code' }, |
| | | }, |
| | | { field: 'workOrderCode', title: '工单编码', width: 140 }, |
| | | { field: 'taskCode', title: '任务编码', width: 140 }, |
| | | { field: 'processName', title: '工序', width: 100 }, |
| | | { field: 'itemName', title: '产品', minWidth: 120 }, |
| | | { field: 'feedbackQuantity', title: '报工数量', width: 100 }, |
| | |
| | | await paramFormApi.resetForm(); |
| | | await nextTick(); |
| | | await paramFormApi.setState({ schema: [...baseSchemas, ...paramSchemas] }); |
| | | |
| | | // 显式设置已有值,确保表单模型绑定正确 |
| | | if (existingValues && existingValues.size > 0) { |
| | | for (const [detailId, value] of existingValues) { |
| | | // 根据参数类型转换值,数值类型需要转为 number |
| | | const detail = details.find((d) => d.id === detailId); |
| | | const paramType = detail?.paramType ?? 1; |
| | | let convertedValue: any = value; |
| | | if ((paramType === 1 || paramType === 2) && value != null && value !== '') { |
| | | convertedValue = Number(value); |
| | | } |
| | | await paramFormApi.setFieldValue(`param_${detailId}`, convertedValue); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** 新增参数记录 */ |
| | |
| | | recordLoading.value = true; |
| | | try { |
| | | const result = await getWorkOrderParamRecordPage({ |
| | | workOrderId: props.workOrderId, |
| | | taskId: props.workOrderId, |
| | | workstationId: props.workstationId, |
| | | pageNo: 1, |
| | | pageSize: 100, |
| | |
| | | <main class="workbench-main"> |
| | | <div class="workbench-main__head"> |
| | | <span class="workbench-main__tab-title">{{ activeTabLabel }}</span> |
| | | <span v-if="selectedTask?.workOrderCode" class="workbench-main__context"> |
| | | 工单 {{ selectedTask.workOrderCode }} |
| | | <span v-if="selectedTask?.code" class="workbench-main__context"> |
| | | 工单 {{ selectedTask.code }} |
| | | </span> |
| | | </div> |
| | | <div class="workbench-main__body"> |
| | |
| | | <RecordParamTab |
| | | v-else-if="activeTab === 'record-param'" |
| | | :task-id="selectedTask?.id" |
| | | :work-order-id="selectedTask?.workOrderId" |
| | | :work-order-id="selectedTask?.id" |
| | | :workstation-id="workstationId" |
| | | /> |
| | | <ProductIssueTab |