| | |
| | | }; |
| | | |
| | | |
| | | const handleSimulationClick = () => { |
| | | const handleSimulationClick = async () => { |
| | | |
| | | try { |
| | | const projectNumber = inputValue.value; |
| | | if (!projectNumber) { |
| | | ElMessage.warning('请输入工程号'); |
| | | return; |
| | | } |
| | | |
| | | const res = await request.post(`/glassOptimize/getProjectState/${projectNumber}`); |
| | | if (Number(res.code) === 200) { |
| | | const projectData = res.data.data; |
| | | |
| | | // 检查 tempering_state 状态 |
| | | if (projectData.tempering_state === 1) { |
| | | // 如果已完成模拟计算,提示用户并阻止继续执行 |
| | | ElMessage.warning('已完成模拟计算,不允许重复计算'); |
| | | return; |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | return; |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error('检查工程状态失败,请稍后重试'); |
| | | console.error('检查工程状态失败:', error); |
| | | return; |
| | | } |
| | | |
| | | |
| | | inputValues.project_no = inputValue.value; |
| | | inputValues.chaos_pct = optionVal.value * 0.01; // 混排等级 |