From f06a784018f560bebb3fb4962f869063d74a3c85 Mon Sep 17 00:00:00 2001
From: guochunsi <1595020186@qq.com>
Date: Wed, 21 Jan 2026 19:32:54 +0800
Subject: [PATCH] a
---
.../recruitstudentsignup/detaiform.vue | 325 ++++++++++--------
.../recruit/recruitstudentsignup/index.vue | 2 +-
2 files changed, 178 insertions(+), 149 deletions(-)
diff --git a/src/views/recruit/recruitstudentsignup/detaiform.vue b/src/views/recruit/recruitstudentsignup/detaiform.vue
index a782118..063b8e3 100644
--- a/src/views/recruit/recruitstudentsignup/detaiform.vue
+++ b/src/views/recruit/recruitstudentsignup/detaiform.vue
@@ -37,9 +37,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -105,58 +164,46 @@
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -171,48 +218,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -340,7 +358,7 @@
@@ -658,7 +669,7 @@ import { ref, reactive, nextTick, watch, computed } from 'vue'
import { ElNotification } from 'element-plus'
import { Picture } from '@element-plus/icons-vue'
import { useMessageBox } from '/@/hooks/message'
-import { getObj, putObj, addObj } from '/@/api/recruit/recruitstudentsignup'
+import { getObj, putObj, addObj ,makeCorrectScore} from '/@/api/recruit/recruitstudentsignup'
import { list as listByGroupId } from '/@/api/recruit/recruitstudentschool'
import { getList } from "/@/api/recruit/recruitstudentplangroup"
import { listByEdu } from "/@/api/recruit/recruitstudentplan"
@@ -667,6 +678,7 @@ import { useDict } from '/@/hooks/dict'
import { areaList, areaSonList } from "/@/api/recruit/recruitstudentschool"
import { list as scoreList } from "/@/api/recruit/recruitstudentplancorrectscoreconfig"
import { queryAllTeacher } from "/@/api/professional/professionaluser/teacherbase"
+import { getNationalList } from "/@/api/basic/basicnation"
import { verifyIdCardAll, verifyAdmissionNumber } from '/@/utils/toolsValidate'
const messageBox = useMessageBox()
@@ -690,12 +702,7 @@ const eduList = ref([])
const imgList = ref([])
const type = ref(null)
const isShow = ref(false)
-
-// 计算属性:判断是否为编辑模式
-const isEdit = computed(() => {
- console.log(type.value)
- return type.value === 1
-})
+const isEdit = ref(false)
// 户口性质
const residenceTypeList = ref([])
const schoolCodeList = ref([])
@@ -719,7 +726,8 @@ const twoMajorList = ref([])
const agencyFeeList = ref([])
const tuitionFeeList = ref([])
const schoolFromList = ref([])
-
+const nationalityList = ref([])
+const idCardTypeList = ref([])
const dataForm = reactive({
id: "",
groupId: "",
@@ -788,6 +796,7 @@ const dataForm = reactive({
jsOtherCity:"",
householdPic:"",
otherProvince:"",
+ idCardType:"",
scorePhotoList: [] as string[],
graPicList: [] as string[],
yyPicList: [] as string[],
@@ -883,18 +892,15 @@ const dataRule = {
parentTel_1: [
{required: true, message: '家长手机不能为空', trigger: 'change'}
],
- wishMajor_1: [
- {required: true, message: '拟报专业不能为空', trigger: 'change'}
+ // wishMajor_1: [
+ // {required: true, message: '拟报专业不能为空', trigger: 'change'}
+ // ],
+ contactName: [
+ {required: true, message: '联系人不能为空', trigger: 'change'}
],
- nutrition: [
+ colorDiscrimination: [
{required: true, message: '辨色力不能为空', trigger: 'change'}
],
- height: [
- {required: true, message: '身高cm不能为空', trigger: 'change'}
- ],
- weight: [
- {required: true, message: '体重kg不能为空', trigger: 'change'}
- ],
correctedScore:[
{required: true, message: '折算分不能为空', trigger: 'change'}
]
@@ -904,6 +910,8 @@ const dataRule = {
const init = (id: string | null, typeParam: number) => {
dataForm.id = id || null
type.value = typeParam
+ isEdit.value = typeParam == 1 ? true : false
+ console.log('typeParam',typeParam,'isEdit',isEdit.value)
visible.value = true
canSubmit.value = true
initData()
@@ -920,7 +928,8 @@ const init = (id: string | null, typeParam: number) => {
areaHomeAreaList.value = []
// 批量获取数据字典(新增和编辑都需要) 文化程度 学费 代办费 户口性质 学校归属地
- getDictsByTypes(['finance_student_source', 'agency_fee', 'tuition_fee','house_hold_properties','recruit_school_form']).then((res: any) => {
+ getDictsByTypes(['id_type','finance_student_source', 'agency_fee', 'tuition_fee','house_hold_properties','recruit_school_form']).then((res: any) => {
+ idCardTypeList.value = res.data.id_type || []
eduList.value = res.data.finance_student_source || []
agencyFeeList.value = res.data.agency_fee || []
tuitionFeeList.value = res.data.tuition_fee || []
@@ -1136,6 +1145,10 @@ const initData = () => {
getList().then((data: any) => {
planList.value = data.data
})
+ // 获取民族列表
+ getNationalList().then((res: any) => {
+ nationalityList.value = res.data
+ })
}
const changeFrom = () => {
@@ -1199,40 +1212,56 @@ const getGzAuditChange = () => {
// 计算成绩折算分
const calculateCorrectedScore = () => {
- if (dataForm.score != undefined && dataForm.fullScore != undefined && dataForm.correctedScore != undefined && !isNaN(Number(dataForm.correctedScore))) {
- dataForm.confirmedMajor = ""
- let fjf = 20
-
- if (dataForm.schoolArea == "3") {
- fjf = 30
+ // 验证必要字段是否存在
+ const hasFullScore = dataForm.fullScore != undefined && dataForm.fullScore != ""
+ const hasSchoolArea = dataForm.schoolArea != undefined && dataForm.schoolArea != ""
+
+ // 验证外省或学校所在省市至少有一个存在
+ const hasLocation = (dataForm.schoolArea === '2' && dataForm.jsOtherCity) ||
+ (dataForm.schoolArea === '3' && dataForm.otherProvince)
+
+ // 只有成绩、当地总分、学校归属地、外省/学校所在省市都存在时才能计算
+ if (!hasFullScore || !hasSchoolArea || !hasLocation) {
+ return
+ }
+
+ dataForm.confirmedMajor = ""
+
+ // 调用后端接口计算折算分
+ makeCorrectScore({
+ groupId: dataForm.groupId,
+ schoolArea: dataForm.schoolArea,
+ jsOtherCity: dataForm.jsOtherCity,
+ otherProvince: dataForm.otherProvince,
+ fullScore: dataForm.fullScore,
+ score: dataForm.score,
+ degreeOfEducation: dataForm.degreeOfEducation
+ }).then(res => {
+ if (res.code !== 0) {
+ return
}
- const score = (parseFloat(String(dataForm.score)) * parseFloat("700"))
- dataForm.correctedScore = String(Math.floor(score / parseFloat(String(dataForm.fullScore)) + fjf))
- // 根据折算分匹配录取专业
- planMajorList.value.forEach((e: any) => {
- if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorOne && (parseFloat(e.xyNum) > 0)) {
- dataForm.confirmedMajor = dataForm.wishMajorOne
- }
- })
- if (dataForm.confirmedMajor == "") {
- planMajorList.value.forEach((e: any) => {
- if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorTwo && (parseFloat(e.xyNum) > 0)) {
- dataForm.confirmedMajor = dataForm.wishMajorTwo
- }
- })
+
+ dataForm.correctedScore = res.data
+
+ // 根据折算分匹配录取专业(按志愿顺序:专业1 -> 专业2 -> 专业3)
+ const matchMajorByScore = (majorCode: string) => {
+ return planMajorList.value.find((major: any) =>
+ dataForm.correctedScore >= major.scoreLine &&
+ major.majorCode == majorCode &&
+ parseFloat(major.xyNum) > 0
+ )
}
-
- if (dataForm.confirmedMajor == "") {
- planMajorList.value.forEach((e: any) => {
- if (dataForm.correctedScore >= e.scoreLine && e.majorCode == dataForm.wishMajorThree && (parseFloat(e.xyNum) > 0)) {
- dataForm.confirmedMajor = dataForm.wishMajorThree
- }
- })
- }
- if (dataForm.confirmedMajor) {
+
+ // 按志愿顺序匹配专业
+ const matchedMajor = matchMajorByScore(dataForm.wishMajorOne) ||
+ matchMajorByScore(dataForm.wishMajorTwo) ||
+ matchMajorByScore(dataForm.wishMajorThree)
+
+ if (matchedMajor) {
+ dataForm.confirmedMajor = matchedMajor.majorCode
changeConfirmedMajor(dataForm.confirmedMajor)
}
- }
+ })
}
const changeR = (changeType: number) => {
diff --git a/src/views/recruit/recruitstudentsignup/index.vue b/src/views/recruit/recruitstudentsignup/index.vue
index 6d90065..6138a56 100644
--- a/src/views/recruit/recruitstudentsignup/index.vue
+++ b/src/views/recruit/recruitstudentsignup/index.vue
@@ -1017,7 +1017,7 @@ const handleFilter = () => {
// 获取数据列表
const handleAddData=()=>{
- addOrUpdateRef.value?.init(null, '1')
+ addOrUpdateRef.value?.init(null, 1)
}
// 新增 / 修改