|
|
@@ -217,8 +217,10 @@ const loader = useSimpleDataLoader(async () => {
|
|
|
userId: authStore.userInfo?.id,
|
|
|
year: new Date().getFullYear(),
|
|
|
});
|
|
|
+ const currentYear = new Date().getFullYear();
|
|
|
if (list.data.length > 0) {
|
|
|
- const detail = await AssessmentContentApi.getAgreementDetail(list.data[0].id);
|
|
|
+ const currentYearItem = list.data.find((item) => item.year === currentYear);
|
|
|
+ const detail = await AssessmentContentApi.getAgreementDetail(currentYearItem?.id || list.data[0].id);
|
|
|
currentAgreement.value = detail;
|
|
|
partyAStampDate.value = { year: '', month: '', day: '' };
|
|
|
partyBSignDate.value = { year: detail.updatetime.getFullYear().toString(), month: (detail.updatetime.getMonth() + 1).toString(), day: detail.updatetime.getDate().toString() };
|