|
|
|
@ -134,6 +134,23 @@ export function checkCompetitiveEnvironmentAnalysisStepThree(payload) {
|
|
|
|
return request({ url: "/api/student-training-answers/competitive-environment-analysis/step-3/validate", method: "post", data: { strategies }, headers: { repeatSubmit: false } });
|
|
|
|
return request({ url: "/api/student-training-answers/competitive-environment-analysis/step-3/validate", method: "post", data: { strategies }, headers: { repeatSubmit: false } });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function checkCompetitiveEnvironmentAnalysisStepFour(payload) {
|
|
|
|
|
|
|
|
const value = payload || {};
|
|
|
|
|
|
|
|
const priorities = Array.isArray(value.priorities) ? value.priorities : [];
|
|
|
|
|
|
|
|
if (isStudentDemo()) {
|
|
|
|
|
|
|
|
const requiredTypes = ["so", "wo", "st", "wt"];
|
|
|
|
|
|
|
|
const ranks = priorities.map((item) => Number(item?.priority));
|
|
|
|
|
|
|
|
if (priorities.length !== requiredTypes.length || requiredTypes.some((type) => !priorities.some((item) => item?.strategyType === type)) || new Set(ranks).size !== 4 || ranks.some((rank) => ![1, 2, 3, 4].includes(rank))) {
|
|
|
|
|
|
|
|
return Promise.reject(new Error("请完成 SO、WO、ST、WT 四类策略的 1 至 4 优先级排序"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!String(value.overallEvaluation || "").trim() || priorities.some((item) => !String(item?.reason || "").trim()) || !String(value.coreRiskOne || "").trim() || !String(value.coreRiskTwo || "").trim() || !String(value.conclusion || "").trim()) {
|
|
|
|
|
|
|
|
return Promise.reject(new Error("请完整填写总体判断、策略理由、至少 2 个风险点和总结结论"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Promise.resolve({ code: 200, data: { valid: true, message: "校验通过" } });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return request({ url: "/api/student-training-answers/competitive-environment-analysis/step-4/validate", method: "post", data: value, headers: { repeatSubmit: false } });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function validateNewProductSurveyStepTwoDemo(form) {
|
|
|
|
function validateNewProductSurveyStepTwoDemo(form) {
|
|
|
|
const value = form || {};
|
|
|
|
const value = form || {};
|
|
|
|
const images = Array.isArray(value.images) ? value.images : [];
|
|
|
|
const images = Array.isArray(value.images) ? value.images : [];
|
|
|
|
|