diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index c2e7719..f93168b 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -52,7 +52,7 @@ 提交 @@ -373,14 +373,28 @@ const reloadCount = () => { }; // 计时器(考核是倒计时,练习是计时) const counter = (counterTime: number) => { - const leave1 = counterTime % (24 * 3600); // 计算天数后剩余的毫秒数 - const leave2 = leave1 % 3600; // 计算小时数后剩余的毫秒数 - const leave3 = leave2 % 60; // 计算分钟数后剩余的毫秒数 + if (counterTime <= 0) { + if (per.value) { + clearInterval(counterTimer.value); + // 考核/竞赛的倒计时结束后自动提交 + submit(); + ElMessageBox.alert(`${per.value === 1 ? '考核' : '竞赛'}时间已到,系统已自动交卷`, '提示', { + confirmButtonText: '确定', + callback: (action: Action) => { + logout(); + }, + }); + } + } else { + const leave1 = counterTime % (24 * 3600); // 计算天数后剩余的毫秒数 + const leave2 = leave1 % 3600; // 计算小时数后剩余的毫秒数 + const leave3 = leave2 % 60; // 计算分钟数后剩余的毫秒数 - day.value = timeFormat(Math.floor(counterTime / (24 * 3600))); - hour.value = timeFormat(Math.floor(leave1 / 3600)); - minutes.value = timeFormat(Math.floor(leave2 / 60)); - seconds.value = timeFormat(Math.round(leave3)); + day.value = timeFormat(Math.floor(counterTime / (24 * 3600))); + hour.value = timeFormat(Math.floor(leave1 / 3600)); + minutes.value = timeFormat(Math.floor(leave2 / 60)); + seconds.value = timeFormat(Math.round(leave3)); + } }; // 启动倒计时 const startCount = () => { @@ -430,13 +444,13 @@ const getCompetitionStatus = async () => { const now = await getNow(); // 如果已经结束 if (now >= endTime) { + submit(); ElMessageBox.alert(`竞赛时间已到,系统已自动交卷`, '提示', { confirmButtonText: '确定', callback: (action: Action) => { logout(); }, }); - submit(); } else { // 没结束,则显示倒计时 countVal.value = (endTime - now) / 1000; @@ -458,10 +472,6 @@ const delCache = async () => { const setNewProject = (reloadPage?: number) => { Cookies.set('sand-projectId', param.projectId); getProDetail(); - setSubmit(false); - countVal.value = 0; - grade.value = '00'; - pannelTab.value = 'first'; reload(); getEntryTime(); @@ -536,86 +546,87 @@ const reload = async (fromReload?: number) => { await delCache(); // 点了重新开始才需要删除缓存,切换了项目不需要删除缓存 Cookies.remove('sand-level'); } - reloadCount(); - grade.value = '00'; - setSubmit(false); - startCount(); - router.push('/'); + if (!per.value) { + reloadCount(); + startCount(); + grade.value = '00'; + pannelTab.value = 'first'; + setSubmit(false); + router.push('/'); + } }; // 提交 const submit = async () => { - if (isSubmit.value) return false; + submiting.value = true; const checkpointId = Cookies.get('sand-level') ?? ''; - if (!checkpointId) return ElMessage.error('请选择关卡'); + const date = new Date(); + const timeSum = Math.ceil((date.getTime() - entryTime.value.getTime()) / 60000); // 计算实验用时(分钟),向上取整 + const submitTime = dayjs(date).format('YYYY-MM-DD HH:mm:ss'); + reloadCount(); + const { retMap } = await submitOpe({ + classId: param.classId ? param.classId : '', + className: param.className ? param.className : '', + curriculumId: param.cid, + startTime: dayjs(entryTime.value).format('YYYY-MM-DD HH:mm:ss'), // 取页面进入的时间 + endTime: per.value ? param.stopTime : submitTime, // 结束时间(考核:直接从职站取考核的结束时间;练习:取提交时间) + submitTime, // 提交时间,即当前时间(这3个时间都是传完整的日期时间格式) + timeSum, + checkpointId, + projectId: param.projectId, + projectName: projectList.value.find((e) => e.projectId == param.projectId)?.projectName, + lcId: curReq.value, + systemId: curSystemId.value, + purpose: pd.value.experimentTarget, // 实验目的 + assessmentId: param.assessmentId, + competitionId: param.competitionId, + stageId: param.stageId, + teamId: param.teamId, + mallId: param.mallId, + }); + setSubmit(true); + + let score = 0; + // 给判分列表添加分数和运行结果 + taskList.value.map((e) => { + const item = retMap?.scoreInfo.find((n) => n.lcId === e.judgmentId); + try { + if (item) { + e.examScore = item.questionScore; + e.finishedResult = item.calculate; // 1:正确,2:错误 + score += item.questionScore; // 计算总分 + } else { + e.examScore = 0; + } + } catch (e) {} + }); + grade.value = score < 10 ? '0' + score : score; + reportId.value = retMap.reportId; + Cookies.set('sand-reportId', retMap.reportId); + Cookies.set('sand-score', grade.value); + localStorage.setItem('sand-taskList', JSON.stringify(taskList.value)); + delCache(); + submiting.value = false; + + // 非练习 + per.value && + ElMessageBox.alert(`提交成功${param.resultAnnouncementTime != 0 ? ',成绩将在' + param.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', { + confirmButtonText: '确定', + callback: (action: Action) => { + logout(); + }, + }); +}; +// 提交前的询问框 +const confirmSubmit = () => { + if (isSubmit.value) return false; + if (!Cookies.get('sand-level')) return ElMessage.error('请选择关卡'); ElMessageBox.confirm('此操作将视为结束考试,是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', closeOnClickModal: false, }) - .then(async () => { - submiting.value = true; - const date = new Date(); - const timeSum = Math.ceil((date.getTime() - entryTime.value.getTime()) / 60000); // 计算实验用时(分钟),向上取整 - const submitTime = dayjs(date).format('YYYY-MM-DD HH:mm:ss'); - reloadCount(); - const { retMap } = await submitOpe({ - classId: param.classId ? param.classId : '', - className: param.className ? param.className : '', - curriculumId: param.cid, - startTime: dayjs(entryTime.value).format('YYYY-MM-DD HH:mm:ss'), // 取页面进入的时间 - endTime: per.value ? param.stopTime : submitTime, // 结束时间(考核:直接从职站取考核的结束时间;练习:取提交时间) - submitTime, // 提交时间,即当前时间(这3个时间都是传完整的日期时间格式) - timeSum, - checkpointId, - projectId: param.projectId, - projectName: projectList.value.find((e) => e.projectId == param.projectId)?.projectName, - lcId: curReq.value, - systemId: curSystemId.value, - purpose: pd.value.experimentTarget, // 实验目的 - assessmentId: param.assessmentId, - competitionId: param.competitionId, - stageId: param.stageId, - teamId: param.teamId, - mallId: param.mallId, - }); - setSubmit(true); - - let score = 0; - // 给判分列表添加分数和运行结果 - taskList.value.map((e) => { - const item = retMap?.scoreInfo.find((n) => n.lcId === e.judgmentId); - try { - if (item) { - e.examScore = item.questionScore; - e.finishedResult = item.calculate; // 1:正确,2:错误 - score += item.questionScore; // 计算总分 - } else { - e.examScore = 0; - } - } catch (e) {} - }); - grade.value = score < 10 ? '0' + score : score; - reportId.value = retMap.reportId; - Cookies.set('sand-reportId', retMap.reportId); - Cookies.set('sand-score', grade.value); - localStorage.setItem('sand-taskList', JSON.stringify(taskList.value)); - delCache(); - submiting.value = false; - - // 非练习 - per.value && - ElMessageBox.alert( - `提交成功${param.resultsDetails == 0 && param.resultAnnouncementTime != 0 ? ',成绩将在' + param.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, - '提示', - { - confirmButtonText: '确定', - callback: (action: Action) => { - logout(); - }, - }, - ); - }) + .then(submit) .catch(() => { submiting.value = false; }); @@ -638,6 +649,7 @@ const getProDetail = async () => { projectName: project.projectName, }, ]; + // Cookies.set('sand-projectName', project.projectName); } curReq.value = pointsList.map((e) => e.judgmentId); // 实验要求默认全部展开,通过judgmentId来选中item points.value = pointsList; @@ -685,9 +697,9 @@ const getMessage = (msg) => { console.log(JSON.parse(msg.data)); const { content } = JSON.parse(msg.data); // 1赛事、2创业、3考核、4模型。-号拼接携带id - if (content == 1) { + if (content == 1 && per.value === 2) { getCompetitionStatus(); - } else if (content.includes('3-')) { + } else if (content.includes('3-') && per.value === 1) { // 考核:3-考核id getAssStatus(); } @@ -728,7 +740,13 @@ const init = async () => { param.cid && getList(); handleCache(); } - Cookies.set('sand-loaded', 1); + + if (!Cookies.get('sand-loaded')) { + Cookies.set('sand-loaded', 1); // 初次加载的标识 + } else if (per.value) { + // 考核/竞赛不查询项目列表,直接查询项目详情 + getProDetail(); + } }; onMounted(init); diff --git a/src/views/product/afterLoan/1029.vue b/src/views/product/afterLoan/1029.vue index 2de9781..40d8ced 100644 --- a/src/views/product/afterLoan/1029.vue +++ b/src/views/product/afterLoan/1029.vue @@ -107,8 +107,7 @@ const getConfig = async () => { process.map((e, i) => { const cur = info.value.length ? info.value[i] : {}; result.push({ - checkpointId: levelId, - projectId, + ...getIds(), recordName: e.name, recordChildren: e.recordChildren, ninetyDays: +cur.ninetyDays || '', @@ -126,7 +125,7 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - const { data } = await fiveLevelClassificationDetails(levelId, projectId); + const { data } = await fiveLevelClassificationDetails(); info.value = data; getConfig(); } finally { diff --git a/src/views/product/afterLoan/1030.vue b/src/views/product/afterLoan/1030.vue index 1446d76..2c10d1d 100644 --- a/src/views/product/afterLoan/1030.vue +++ b/src/views/product/afterLoan/1030.vue @@ -78,8 +78,6 @@ import type { TableColumnCtx } from 'element-plus'; import { handleId, getIds } from '@/utils/common'; import Cookies from 'js-cookie'; -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); // 配置项 @@ -89,8 +87,7 @@ const getConfig = async () => { process.map((e, i) => { const cur = info.value.length ? info.value[i] : {}; let temp = { - checkpointId: levelId, - projectId, + ...getIds(), recordName: e.name, recordChildren: e.recordChildren, checkObject: +cur.checkObject || '', @@ -109,7 +106,7 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - const { data } = await postLoanInspectionDetails(levelId, projectId); + const { data } = await postLoanInspectionDetails(); info.value = data; getConfig(); } finally { diff --git a/src/views/product/afterLoan/1031.vue b/src/views/product/afterLoan/1031.vue index 5e19178..d0ea00e 100644 --- a/src/views/product/afterLoan/1031.vue +++ b/src/views/product/afterLoan/1031.vue @@ -185,8 +185,6 @@ import type { TableColumnCtx } from 'element-plus'; import { handleId, getIds } from '@/utils/common'; import Cookies from 'js-cookie'; -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); // 配置项 @@ -199,8 +197,7 @@ const getConfig = async () => { ]; process.map((e, i) => { let temp = { - checkpointId: levelId, - projectId, + ...getIds(), recordName: e.name, recordChildren: e.recordChildren, formulaOne: '', @@ -236,7 +233,7 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - const { data } = await postCreditScoreDetails(levelId, projectId); + const { data } = await postCreditScoreDetails(); info.value = data; getConfig(); } finally { diff --git a/src/views/product/afterLoan/1032.vue b/src/views/product/afterLoan/1032.vue index e12a8cd..86a3bc5 100644 --- a/src/views/product/afterLoan/1032.vue +++ b/src/views/product/afterLoan/1032.vue @@ -65,8 +65,7 @@ const getConfig = async () => { process.map((e, i) => { const cur = info.value.length ? info.value[i] : {}; result.push({ - checkpointId: levelId, - projectId, + ...getIds(), recordName: e.name, recordChildren: e.recordChildren, riskGrade: +cur.riskGrade || '', @@ -81,7 +80,7 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - const { data } = await postLoanWarningDetails(levelId, projectId); + const { data } = await postLoanWarningDetails(); info.value = data; getConfig(); } finally { diff --git a/src/views/product/afterLoan/1033.vue b/src/views/product/afterLoan/1033.vue index 166d8e3..e1c4d08 100644 --- a/src/views/product/afterLoan/1033.vue +++ b/src/views/product/afterLoan/1033.vue @@ -92,8 +92,7 @@ const getConfig = async () => { process[0].recordChildren.map((e, i) => { const cur = info.value.length ? info.value[i] : {}; result.push({ - checkpointId: levelId, - projectId, + ...getIds(), recordName: e.name, recordChildren: e.recordChildren, appCollection: info.value.length ? !!cur.appCollection : false, @@ -111,7 +110,7 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - const { data } = await collectionAfterLoanDetails(levelId, projectId); + const { data } = await collectionAfterLoanDetails(); info.value = data; getConfig(); } finally { diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index eb246c6..f81db78 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -46,10 +46,17 @@ @@ -627,7 +634,7 @@ interface RuleForm { selectionStrategyCheck?: number; selectionStrategy: any; sendingAccountCheck?: number; - sendingAccount: any; + sendingAccount: number[]; supplementaryMaterialsCheck?: number; supplementaryMaterials: any; } @@ -703,7 +710,7 @@ const form = reactive({ selectionStrategyCheck: '', selectionStrategy: [], sendingAccountCheck: '', - sendingAccount: '', + sendingAccount: [], supplementaryMaterialsCheck: '', supplementaryMaterials: [], }); @@ -759,7 +766,7 @@ const submit = async (formEl: FormInstance | undefined) => { const param = JSON.parse(JSON.stringify(form)); if (param.accountMaterialsCheck === 797 && !param.accountMaterials.length) return ElMessage.error('请选择需要提供的申请人材料'); - if (param.sendingAccountCheck === 801 && !param.sendingAccount) return ElMessage.error('请选择需要发放的账户'); + if (param.sendingAccountCheck === 801 && !param.sendingAccount.length) return ElMessage.error('请选择需要发放的账户'); if (!param.loanApplicationMethod.length) return ElMessage.error('请选择申请方式'); if (param.borrowerMaterialCheck === 797 && !param.borrowerMaterial.length) return ElMessage.error('请选择借款人材料'); @@ -787,7 +794,7 @@ const submit = async (formEl: FormInstance | undefined) => { param.accessStrategy = param.accessStrategyCheck === 803 ? param.accessStrategy.join() : ''; param.borrowerMaterial = param.borrowerMaterial.join(); param.accountMaterials = param.accountMaterialsCheck === 797 ? param.accountMaterials.join() : ''; - if (param.sendingAccountCheck === 802) param.sendingAccount = ''; + param.sendingAccount = param.sendingAccountCheck === 801 ? param.sendingAccount.join() : ''; // 企业 param.collateral = param.collateralCheck === 797 ? param.collateral.join() : ''; param.enterpriseMaterial = param.enterpriseMaterialCheck === 797 ? param.enterpriseMaterial.join() : ''; @@ -811,7 +818,6 @@ const submit = async (formEl: FormInstance | undefined) => { param.runBatchObject = param.runBatchObjectCheck === 803 ? param.runBatchObject.join() : ''; param.selectionStrategy = param.selectionStrategyCheck === 803 ? param.selectionStrategy.join() : ''; param.supplementaryMaterials = param.supplementaryMaterialsCheck === 797 ? param.supplementaryMaterials.join() : ''; - if (param.contractMaterialsCheck !== 797) param.contractMaterials = ''; if (info.value.riskControlDetails) { param.id = info.value.riskControlDetails.id; diff --git a/src/views/product/fund/Add.vue b/src/views/product/fund/Add.vue index 69700cb..25e81be 100644 --- a/src/views/product/fund/Add.vue +++ b/src/views/product/fund/Add.vue @@ -210,8 +210,8 @@

运作费计算:

管理费 = (前一日的基金资产净值 x 管理费率)/ 365

-

托管费 = (前一日的基金资产净值 x 管理费率)/ 365

-

销售服务费 = (前一日的基金资产净值 x 管理费率)/ 365

+

托管费 = (前一日的基金资产净值 x 托管费率)/ 365

+

销售服务费 = (前一日的基金资产净值 x 销售服务费率)/ 365

diff --git a/src/views/product/interestRate/772.vue b/src/views/product/interestRate/772.vue index d22cc1d..df4fcfe 100644 --- a/src/views/product/interestRate/772.vue +++ b/src/views/product/interestRate/772.vue @@ -95,12 +95,9 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref>({ - projectId, - checkpointId: levelId, + ...getIds(), andThird: '', firstMode: '', secondMode: '', @@ -175,7 +172,7 @@ const getConfig = async () => { const getDetail = async (load?: number) => { if (load) loading = ElLoading.service(); try { - const { data } = await personalCreditModelDetails(levelId, projectId); + const { data } = await personalCreditModelDetails(); if (data) { form.value = data; info.value = data.individualCreditModels; diff --git a/src/views/product/interestRate/773.vue b/src/views/product/interestRate/773.vue index 81f9108..1a5b10c 100644 --- a/src/views/product/interestRate/773.vue +++ b/src/views/product/interestRate/773.vue @@ -95,12 +95,9 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref>({ - projectId, - checkpointId: levelId, + ...getIds(), andFirst: '', andSecond: '', andThird: '', @@ -123,7 +120,7 @@ const getConfig = async () => { const getDetail = async (load?: number) => { if (load) loading = ElLoading.service(); try { - const { data } = await businessQuotaModelDetails(levelId, projectId); + const { data } = await businessQuotaModelDetails(); if (data) { form.value = data; } diff --git a/src/views/product/interestRate/935.vue b/src/views/product/interestRate/935.vue index 58c8f7d..797df63 100644 --- a/src/views/product/interestRate/935.vue +++ b/src/views/product/interestRate/935.vue @@ -20,7 +20,6 @@ @@ -99,12 +98,9 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref>({ - projectId, - checkpointId: levelId, + ...getIds(), finalFloatingRatioEqual: '', finalFloatingRatioGreater: '', finalFloatingRatioLess: '', @@ -159,7 +155,7 @@ const getConfig = async () => { const getDetail = async (load?: number) => { if (load) loading = ElLoading.service(); try { - const { data } = await personalInterestRateDetails(levelId, projectId); + const { data } = await personalInterestRateDetails(); if (data) { form.value = data; info.value = data.individualInterestRateModels; diff --git a/src/views/product/interestRate/936.vue b/src/views/product/interestRate/936.vue index ab036f8..d78b378 100644 --- a/src/views/product/interestRate/936.vue +++ b/src/views/product/interestRate/936.vue @@ -107,12 +107,9 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref>({ - projectId, - checkpointId: levelId, + ...getIds(), finalFloatingRatioEqual: '', finalFloatingRatioGreater: '', finalFloatingRatioLess: '', @@ -206,7 +203,7 @@ const getConfig = async () => { const getDetail = async (load?: number) => { if (load) loading = ElLoading.service(); try { - const { data } = await businessInterestRateDetails(levelId, projectId); + const { data } = await businessInterestRateDetails(); if (data) { form.value = data; info.value = data.corporateInterestRateModelIndicators; diff --git a/src/views/product/strategy/152.vue b/src/views/product/strategy/152.vue index 2318258..a00d653 100644 --- a/src/views/product/strategy/152.vue +++ b/src/views/product/strategy/152.vue @@ -176,8 +176,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); const spanRows = [1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27]; diff --git a/src/views/product/strategy/153.vue b/src/views/product/strategy/153.vue index c9004c5..3503f3e 100644 --- a/src/views/product/strategy/153.vue +++ b/src/views/product/strategy/153.vue @@ -146,8 +146,6 @@ import { handleId, getNum, getChinese, getIds } from '@/utils/common'; import Cookies from 'js-cookie'; const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); const nums: Array = [1, 3, 5, 10, 20, 30, 40]; @@ -184,6 +182,10 @@ const getConfig = async () => { }; result.push(temp); }); + result.push({ + name: '正常', + remark: '不存在未结清情况', + }); form.value = result; }; // 详情 diff --git a/src/views/product/strategy/154.vue b/src/views/product/strategy/154.vue index 453f884..09d037a 100644 --- a/src/views/product/strategy/154.vue +++ b/src/views/product/strategy/154.vue @@ -290,8 +290,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); const symbols: Array = ['>=', '<', '>', '==', '<=']; diff --git a/src/views/product/strategy/155.vue b/src/views/product/strategy/155.vue index 1efa87c..3f98981 100644 --- a/src/views/product/strategy/155.vue +++ b/src/views/product/strategy/155.vue @@ -139,8 +139,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); const symbols: Array = ['>=', '<', '>', '==', '<=']; diff --git a/src/views/product/strategy/156.vue b/src/views/product/strategy/156.vue index 298b945..5395d99 100644 --- a/src/views/product/strategy/156.vue +++ b/src/views/product/strategy/156.vue @@ -80,8 +80,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); const form = ref[]>([]); const info = ref[]>([]); // 配置项 diff --git a/src/views/product/strategy/Credit.vue b/src/views/product/strategy/Credit.vue index ada738f..4a2873c 100644 --- a/src/views/product/strategy/Credit.vue +++ b/src/views/product/strategy/Credit.vue @@ -185,8 +185,6 @@ const emit = defineEmits(['getList']); const router = useRouter(); const route = useRoute(); const id = computed(() => +route.query.creditId); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const list = ref[]>([]); const list1 = ref[]>([]); @@ -202,8 +200,7 @@ const scoringObjects = ref>([ }, ]); const form = reactive({ - checkpointId: levelId, - projectId, + ...getIds(), description: '', scoreCardName: '', scoringObject: 0, @@ -627,9 +624,7 @@ const getDetail = async (load?: number) => { const info = res.scoringStrategy; if (info) { detail.value = info.dimensionOfTheRatingTableList; - form.checkpointId = info.checkpointId; form.description = info.description; - form.projectId = info.projectId; form.scoreCardName = info.scoreCardName; form.scoringObject = info.scoringObject; } @@ -639,9 +634,7 @@ const getDetail = async (load?: number) => { } else { getConfig(); detail.value = []; - form.checkpointId = levelId; form.description = ''; - form.projectId = projectId; form.scoreCardName = ''; form.scoringObject = 0; } @@ -850,6 +843,7 @@ const submit = async () => { // debugger; const res = await saveCredit({ ...form, + ...getIds(), dimensionOfTheRatingTableList: param, }); addRecord(); diff --git a/src/views/product/strategy/Risk1.vue b/src/views/product/strategy/Risk1.vue index c2d4f0a..f0e24e2 100644 --- a/src/views/product/strategy/Risk1.vue +++ b/src/views/product/strategy/Risk1.vue @@ -64,8 +64,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref[]>([]); const info = ref[]>([]); @@ -77,8 +75,7 @@ const getConfig = async () => { e.recordChildren[0]?.recordChildren?.forEach((n, j) => { const cur = info.value.length ? info.value[i ? 10 + j : j] : {}; result.push({ - checkpointId: levelId, - projectId, + ...getIds(), coefficient: cur?.coefficient || '', id: cur?.id || '', answerId: n.id, diff --git a/src/views/product/strategy/Risk2.vue b/src/views/product/strategy/Risk2.vue index 13414f3..970872d 100644 --- a/src/views/product/strategy/Risk2.vue +++ b/src/views/product/strategy/Risk2.vue @@ -48,8 +48,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref[]>([]); const info = ref[]>([]); @@ -60,8 +58,7 @@ const getConfig = async () => { process[0]?.recordChildren?.forEach((e, i) => { const cur = {}; let temp = { - checkpointId: levelId, - projectId, + ...getIds(), coefficient: cur?.coefficient || '', id: cur?.id || '', recordName: e.name, diff --git a/src/views/product/strategy/Risk3.vue b/src/views/product/strategy/Risk3.vue index 350e354..6b25dd8 100644 --- a/src/views/product/strategy/Risk3.vue +++ b/src/views/product/strategy/Risk3.vue @@ -48,8 +48,6 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); -const projectId = +Cookies.get('sand-projectId'); -const levelId = +Cookies.get('sand-level'); let loading = null; const form = ref[]>([]); const info = ref[]>([]); @@ -60,8 +58,7 @@ const getConfig = async () => { process[0]?.recordChildren?.forEach((e, i) => { const cur = {}; let temp = { - checkpointId: levelId, - projectId, + ...getIds(), coefficient: cur?.coefficient || '', id: cur?.id || '', recordName: e.name,