| | |
| | | return data; |
| | | } |
| | | |
| | | /** 加载 checkFlag */ |
| | | async function resolveCheckFlag(routeId?: number, processId?: number) { |
| | | /** 加载 checkFlag:任务(工单工序快照)优先,缺失时回退工艺路线工序 */ |
| | | async function resolveCheckFlag( |
| | | routeId?: number, |
| | | processId?: number, |
| | | taskCheckFlag?: boolean, |
| | | ) { |
| | | if (typeof taskCheckFlag === 'boolean') return taskCheckFlag; |
| | | if (!routeId || !processId) return true; |
| | | try { |
| | | const rp = await getRouteProcessByRouteAndProcess(routeId, processId); |
| | |
| | | formApi.setState({ schema: useFormSchema(formType.value, formApi) }); |
| | | |
| | | const code = await generateAutoCode(MesAutoCodeRuleCode.PRO_FEEDBACK_CODE); |
| | | const checkFlag = await resolveCheckFlag(task.routeId, task.processId); |
| | | const checkFlag = await resolveCheckFlag( |
| | | task.routeId, |
| | | task.processId, |
| | | task.checkFlag, |
| | | ); |
| | | |
| | | await formApi.setValues({ |
| | | code, |
| | |
| | | feedbackStatus.value = data.status; |
| | | formType.value = 'update'; |
| | | formApi.setState({ schema: useFormSchema(formType.value, formApi) }); |
| | | const checkFlag = await resolveCheckFlag(data.routeId, data.processId); |
| | | const checkFlag = await resolveCheckFlag( |
| | | data.routeId, |
| | | data.processId, |
| | | data.checkFlag, |
| | | ); |
| | | await formApi.setValues({ ...data, checkFlag }); |
| | | originalSnapshot.value = JSON.stringify(await getAlignedData(false)); |
| | | } |