| src/api/mes/pro/feedback/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/api/mes/pro/route/process/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/api/mes/pro/task/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/router/guard.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/store/auth.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mes/pro/feedback/data.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mes/pro/feedback/modules/form.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mes/pro/route/data.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mes/pro/task/data.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/mes/pro/feedback/index.ts
@@ -64,6 +64,12 @@ createTime?: number; // 创建时间 processInstanceId?: string; // BPM 流程实例编号 processDefinitionKey?: string; // BPM 流程定义 Key paramValues?: ParamValue[]; } export interface ParamValue { detailId: number; value?: string; } /** MES 生产报工分页查询参数 */ @@ -163,6 +169,7 @@ /** 快速报工请求 */ export interface QuickCreateReq { taskId: number; paramValues?: MesProFeedbackApi.ParamValue[]; feedbackQuantity: number; qualifiedQuantity?: number; unqualifiedQuantity?: number; src/api/mes/pro/route/process/index.ts
@@ -15,6 +15,7 @@ id?: number; routeId?: number; processId?: number; paramTemplateId?: number; processCode?: string; processName?: string; sort?: number; src/api/mes/pro/task/index.ts
@@ -29,6 +29,7 @@ workstationName?: string; // 工作站名称 routeId?: number; // 工艺路线编号 processId?: number; // 工序编号 paramTemplateId?: number; // 工艺参数模板编号 processName?: string; // 工序名称 itemId?: number; // 产品物料编号 itemCode?: string; // 产品编码 src/router/guard.ts
@@ -60,8 +60,7 @@ if (to.path === LOGIN_PATH && accessStore.accessToken) { return decodeURIComponent( (to.query?.redirect as string) || userStore.userInfo?.homePath || preferences.app.defaultHomePath, '/analytics', ); } return true; @@ -132,7 +131,7 @@ userStore.setUserRoles(userRoles); const redirectPath = (from.query.redirect ?? (to.path === preferences.app.defaultHomePath ? userInfo?.homePath || preferences.app.defaultHomePath ? '/analytics' : to.fullPath)) as string; return { src/store/auth.ts
@@ -86,9 +86,7 @@ // oxlint-disable-next-line no-unused-expressions onSuccess ? await onSuccess?.() : await router.push( userInfo.homePath || preferences.app.defaultHomePath, ); : await router.push('/analytics'); } if (userInfo?.nickname) { src/views/mes/pro/feedback/data.ts
@@ -18,6 +18,7 @@ import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { getRouteProcessByRouteAndProcess } from '#/api/mes/pro/route/process'; import { getWorkOrderParamRecordPage } from '#/api/mes/pro/workorderparamrecord'; import { getSimpleUserList } from '#/api/system/user'; import { getRangePickerDefaultProps } from '#/utils'; import { MdItemSelect } from '#/views/mes/md/item/components'; src/views/mes/pro/feedback/modules/form.vue
@@ -11,7 +11,7 @@ import { MesAutoCodeRuleCode, MesProFeedbackStatusEnum } from '@vben/constants'; import { useUserStore } from '@vben/stores'; import { Button, message, Popconfirm, Tabs } from 'ant-design-vue'; import { Button, Input, message, Popconfirm, Tabs } from 'ant-design-vue'; import { useVbenForm } from '#/adapter/form'; import { generateAutoCode } from '#/api/mes/md/autocode/record'; @@ -26,6 +26,7 @@ } from '#/api/mes/pro/feedback'; import { getRouteProcessByRouteAndProcess } from '#/api/mes/pro/route/process'; import { getWorkOrder } from '#/api/mes/pro/workorder'; import { getWorkOrderParamRecordPage } from '#/api/mes/pro/workorderparamrecord'; import { $t } from '#/locales'; import { useFormSchema } from '../data'; @@ -40,6 +41,7 @@ const userStore = useUserStore(); const subTabsName = ref('itemConsume'); const originalSnapshot = ref(''); // 表单原始数据快照,用于 submit 时跳过未变更的保存请求 const paramDetails = ref<Array<{ id: number; paramName?: string; paramCode?: string; unitMeasureName?: string; paramValue?: string }>>([]); const isEditable = computed(() => ['create', 'submit', 'update'].includes(formType.value), @@ -105,6 +107,7 @@ /** 读取并按提交规则对齐后的表单数据,用于快照和保存 */ async function getAlignedData(): Promise<MesProFeedbackApi.Feedback> { const data = (await formApi.getValues()) as MesProFeedbackApi.Feedback; syncParamValues(data); alignQuantity(data); return data; } @@ -145,6 +148,27 @@ const batchDialogRef = ref<InstanceType<typeof BatchInputDialog>>(); const batchActionType = ref<'submit' | 'approve'>(''); async function loadParamDetails(taskId?: number) { paramDetails.value = []; if (!taskId) return; const page = await getWorkOrderParamRecordPage({ taskId, pageNo: 1, pageSize: 1 }); const record = page.list?.[0]; paramDetails.value = (record?.details ?? []).map((detail) => ({ id: detail.id!, paramCode: detail.paramCode, paramName: detail.paramName, unitMeasureName: detail.unitMeasureName, paramValue: detail.paramValue, })); } function syncParamValues(data: MesProFeedbackApi.Feedback) { data.paramValues = paramDetails.value.map((detail) => ({ detailId: detail.id, value: detail.paramValue, })); } /** 执行提交(含批次属性) */ async function doSubmit(batchFields?: Record<string, unknown>) { @@ -336,6 +360,7 @@ modalApi.lock(); try { formData.value = await getFeedback(data.id); await loadParamDetails(formData.value.taskId); const checkFlag = await resolveCheckFlag( formData.value.routeId, formData.value.processId, @@ -354,6 +379,17 @@ <template> <Modal :title="getTitle" class="w-3/5"> <Form class="mx-4" /> <div v-if="paramDetails.length" class="mx-4 mt-4 rounded border border-gray-200 p-4"> <div class="mb-3 font-medium">工艺参数</div> <div class="grid grid-cols-2 gap-3"> <div v-for="detail in paramDetails" :key="detail.id" class="flex items-center gap-2"> <span class="w-40 text-right text-sm text-gray-600"> {{ detail.paramName || detail.paramCode }}{{ detail.unitMeasureName ? `(${detail.unitMeasureName})` : '' }} </span> <Input v-model:value="detail.paramValue" :disabled="!isEditable" placeholder="请输入参数值" /> </div> </div> </div> <Tabs v-if="showSubTabs" v-model:active-key="subTabsName" src/views/mes/pro/route/data.ts
@@ -18,6 +18,7 @@ import { z } from '#/adapter/form'; import { generateAutoCode } from '#/api/mes/md/autocode/record'; import { getTemplatePage } from '#/api/mes/pro/processdesign/template'; import { MdItemSelect, MdProductBomSelect, @@ -216,6 +217,19 @@ rules: 'selectRequired', }, { fieldName: 'paramTemplateId', label: '工艺参数模板', component: 'ApiSelect', componentProps: { api: () => getTemplatePage({ pageNo: 1, pageSize: 100 }), labelField: 'templateName', valueField: 'id', resultField: 'list', allowClear: true, placeholder: '请选择工艺参数模板', }, }, { fieldName: 'linkType', label: '与下道工序关系', component: 'Select', src/views/mes/pro/task/data.ts
@@ -2,6 +2,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { z } from '#/adapter/form'; import { getSimpleUserListByRoleCode } from '#/api/system/user'; import { getTemplatePage } from '#/api/mes/pro/processdesign/template'; import type { MesProTaskApi } from '#/api/mes/pro/task'; import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder'; @@ -396,6 +397,19 @@ export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>, feedbackRole?: Ref<string | undefined>): VbenFormSchema[] { return [ { fieldName: 'paramTemplateId', label: '工艺参数模板', component: 'ApiSelect', componentProps: { api: () => getTemplatePage({ pageNo: 1, pageSize: 100 }), labelField: 'templateName', valueField: 'id', resultField: 'list', allowClear: true, placeholder: '请选择工艺参数模板', }, }, { fieldName: 'workstationId', label: '工作站', component: markRaw(MdWorkstationSelect),