lifanagju_citu преди 3 месеца
родител
ревизия
d23586c8dc

+ 24 - 0
src/api/recruit/personal/resume/index.js

@@ -205,6 +205,30 @@ export const enterpriseSearchByName = async (params) => {
   })
 }
 
+// 学校列表
+export const schoolList = async (data) => {
+  return await request.post({
+    url: 'app-api/flames/school/list',
+    data
+  })
+}
+
+// 院系列表
+export const departmentList = async (data) => {
+  return await request.post({
+    url: 'app-api/flames/school/department/list',
+    data
+  })
+}
+
+// 获取学生基本信息
+export const getStudentInfo = async (data) => {
+  return await request.post({
+    url: 'app-api/menduner/system/person/resume/student/get',
+    data
+  })
+}
+
 // 保存附件
 export const savePersonResumeCv = async (data) => {
   return await request.post({

+ 37 - 69
src/plugins/dialogExtend/components/studentInfoForm.vue

@@ -27,13 +27,11 @@
 import { getDict } from '@/hooks/web/useDictionaries'
 defineOptions({name: 'dialogExtend-InfoForm'})
 import { reactive, ref } from 'vue'
-import { schoolMajorByName, schoolSearchByName } from '@/api/recruit/personal/resume'
+import { schoolList, departmentList } from '@/api/recruit/personal/resume'
 import { getUserAvatar } from '@/utils/avatar'
 import { uploadFile } from '@/api/common'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
-import { debounce } from 'lodash'
-import { dealCanBeInputtedSave } from '@/utils/getText'
 import { isValidIdCard18 } from '@/utils/validate'
 
 const props = defineProps({
@@ -46,46 +44,6 @@ const setInfo = ref(props.option?.setInfo ? props.option.setInfo : {})
 const formPageRef = ref()
 let query = reactive({})
 
-// 学校下拉列表
-const schoolNameInput = ref('')
-const getSchoolListData = async (name) => {
-  const item = items.value.options.find(e => e.key === 'schoolId')
-  if (!item) return
-  if (item.items?.length && (schoolNameInput.value === name)) return // 防抖
-  item[item.itemTextName] = schoolNameInput.value = name
-
-  if (name === null || name === '') { item.items = [] }
-  else {
-    const data = await schoolSearchByName({ name })
-    item.items = data
-  }
-}
-const debouncedCallbackSchool = debounce(newValue => {
-  if (!newValue) return
-  getSchoolListData(newValue)
-}, 500)
-
-// 专业下拉列表
-const majorNameInput = ref('')
-const getMajorListData = async (name) => {
-  const item = items.value.options.find(e => e.key === 'majorId')
-  if (name === '') { // 此接口不支持传空值
-    item.items = []
-    return
-  }
-  if (item.items?.length && (majorNameInput.value === name)) return // 防抖
-  item[item.itemTextName] = majorNameInput.value = name
-  
-  if (name === null || name === '') { item.items = [] }
-  else {
-    const data = await schoolMajorByName({ name })
-    item.items = data
-  }
-}
-const debouncedCallbackMajor = debounce(newValue => {
-  getMajorListData(newValue)
-}, 500)
-
 // 图片裁剪
 const selectPic = ref('')
 const isShowCopper = ref(false)
@@ -174,45 +132,38 @@ const items = ref({
       rules: [v => !!v || '请选择出生日期']
     },
     {
-      type: 'combobox',
+      type: 'autocomplete',
       key: 'schoolId',
       value: null,
       default: null,
-      label: '学校名称 *',
+      label: '就读学校 *',
       outlined: true,
-      clearable: true,
-      canBeInputted: true, //
-      itemTextName: 'schoolName',
-      itemText: 'value',
-      itemValue: 'key',
-      rules: [v => !!v || '请选择学校名称'],
-      search: debouncedCallbackSchool,
+      itemText: 'schoolName',
+      itemValue: 'schoolId',
+      rules: [v => !!v || '请选择就读学校'],
       items: [],
+      change: e => getDepartmentList(e),
     },
     {
-      type: 'text',
+      type: 'autocomplete',
       key: 'schoolDepartmentName',
-      value: '',
+      value: null,
       default: null,
       label: '所在院系 *',
       outlined: true,
-      rules: [v => !!v || '请填写所在院系']
+      itemText: 'departmentTitle',
+      itemValue: 'schoolDepartmentId',
+      rules: [v => !!v || '请选择所在院系'],
+      items: []
     },
     {
-      type: 'combobox',
-      key: 'majorId',
-      value: null,
+      type: 'text',
+      key: 'majorName',
+      value: '',
       default: null,
       label: '所学专业 *',
       outlined: true,
-      clearable: true,
-      canBeInputted: true, //
-      itemTextName: 'major',
-      itemText: 'nameCn',
-      itemValue: 'id',
-      rules: [v => !!v || '请选择所学专业'],
-      search: debouncedCallbackMajor,
-      items: []
+      rules: [v => !!v || '请输入所学专业']
     },
     {
       type: 'text',
@@ -256,6 +207,26 @@ if (import.meta.env.VITE_NODE_ENV === 'production') {
   items.value.options = items.value.options.filter(e => e.slotName !== 'analysis')
 }
 
+// // 学校下拉列表
+const getSchoolListData = async () => {
+  const item = items.value.options.find(e => e.key === 'schoolId')
+  if (!item) return
+  const { records } = await schoolList({current: 1,size: 9999})
+  item.items = records || []
+}
+getSchoolListData()
+
+const getDepartmentList = async (e) => {
+  const item = items.value.options.find(e => e.key === 'schoolDepartmentName')
+  if (!item) return
+  const query = {
+    page: { size: 9999,	current: 1	},
+    entity: { schoolId: e }
+  }
+  const res = await departmentList(query)
+  const list = res?.records?.length ? res.records : []
+  item.items = list.map(e => e.entity)
+}
 
 // 选择文件
 const fileInput = ref()
@@ -334,9 +305,6 @@ const getQuery = async () => {
   items.value.options.forEach(e => {
     if (Object.prototype.hasOwnProperty.call(e, 'data')) return obj[e.key] = e.data
     obj[e.key] = e.value === '' ? null : e.value
-    if (e.canBeInputted) { // 特殊处理可输入下拉框
-      dealCanBeInputtedSave(e, obj)
-    }
   })
   if (!obj.avatar) obj.avatar = getUserAvatar(null, obj.sex)
   query = Object.assign(query, obj)

+ 55 - 70
src/views/recruit/personal/PersonalCenter/studentInformation/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div style="padding: 20px 30px">
     <div class="resume-header mb-3">
-      <div class="resume-title">学生学籍信息</div>
+      <div class="resume-title">学生信息认证</div>
     </div>
     <div class="d-flex flex-column align-center pt-5">
       <CtForm ref="CtFormRef" :items="items" style="width: 900px;"></CtForm>
@@ -16,98 +16,51 @@
 defineOptions({name: 'personal-personCenter-studentInformation-index'})
 import { ref } from 'vue'
 import { saveStudentSimpleInfo } from '@/api/recruit/personal/shareJob'
+import { schoolList, departmentList, getStudentInfo } from '@/api/recruit/personal/resume'
 import { useI18n } from '@/hooks/web/useI18n'
 import Snackbar from '@/plugins/snackbar'
-import { debounce } from 'lodash'
 import { isValidIdCard18 } from '@/utils/validate'
-import { dealCanBeInputtedSave } from '@/utils/getText'
 
 const { t } = useI18n()
 
 const overlay = ref(false)
-// 学校下拉列表
-const schoolNameInput = ref('')
-const getSchoolListData = async (name) => {
-  const item = items.value.options.find(e => e.key === 'schoolId')
-  if (!item) return
-  if (item.items?.length && (schoolNameInput.value === name)) return // 防抖
-  item[item.itemTextName] = schoolNameInput.value = name
-
-  if (name === null || name === '') { item.items = [] }
-  else {
-    const data = await schoolSearchByName({ name })
-    item.items = data
-  }
-}
-const debouncedCallbackSchool = debounce(newValue => {
-  if (!newValue) return
-  getSchoolListData(newValue)
-}, 500)
-
-// 专业下拉列表
-const majorNameInput = ref('')
-const getMajorListData = async (name) => {
-  const item = items.value.options.find(e => e.key === 'majorId')
-  if (name === '') { // 此接口不支持传空值
-    item.items = []
-    return
-  }
-  if (item.items?.length && (majorNameInput.value === name)) return // 防抖
-  item[item.itemTextName] = majorNameInput.value = name
-  
-  if (name === null || name === '') { item.items = [] }
-  else {
-    const data = await schoolMajorByName({ name })
-    item.items = data
-  }
-}
-const debouncedCallbackMajor = debounce(newValue => {
-  getMajorListData(newValue)
-}, 500)
 
 const CtFormRef = ref()
 const items = ref({
   options: [
     {
-      type: 'combobox',
+      type: 'autocomplete',
       key: 'schoolId',
       value: null,
       default: null,
-      label: '学校名称 *',
+      label: '就读学校 *',
       outlined: true,
-      clearable: true,
-      canBeInputted: true, //
-      itemTextName: 'schoolName',
-      itemText: 'value',
-      itemValue: 'key',
-      rules: [v => !!v || '请选择学校名称'],
-      search: debouncedCallbackSchool,
+      itemText: 'schoolName',
+      itemValue: 'schoolId',
+      rules: [v => !!v || '请选择就读学校'],
       items: [],
+      change: e => getDepartmentList(e),
     },
     {
-      type: 'text',
+      type: 'autocomplete',
       key: 'schoolDepartmentName',
-      value: '',
+      value: null,
       default: null,
       label: '所在院系 *',
       outlined: true,
-      rules: [v => !!v || '请填写所在院系']
+      itemText: 'departmentTitle',
+      itemValue: 'schoolDepartmentId',
+      rules: [v => !!v || '请选择所在院系'],
+      items: []
     },
     {
-      type: 'combobox',
-      key: 'majorId',
-      value: null,
+      type: 'text',
+      key: 'majorName',
+      value: '',
       default: null,
       label: '所学专业 *',
       outlined: true,
-      clearable: true,
-      canBeInputted: true, //
-      itemTextName: 'major',
-      itemText: 'nameCn',
-      itemValue: 'id',
-      rules: [v => !!v || '请选择所学专业'],
-      search: debouncedCallbackMajor,
-      items: []
+      rules: [v => !!v || '请输入所学专业']
     },
     {
       type: 'text',
@@ -166,25 +119,57 @@ const items = ref({
     },
   ]
 })
+
 // 左侧加mr
 items.value.options.forEach((e, index) => {
   e.col = 6
   if ((index + 2) % 2 === 0) e.flexStyle = 'mr-3'
 })
 
+// // 学校下拉列表
+const getSchoolListData = async () => {
+  const item = items.value.options.find(e => e.key === 'schoolId')
+  if (!item) return
+  const { records } = await schoolList({current: 1,size: 9999})
+  item.items = records || []
+}
+getSchoolListData()
+
+const getDepartmentList = async (e) => {
+  const item = items.value.options.find(e => e.key === 'schoolDepartmentName')
+  if (!item) return
+  const query = {
+    page: { size: 9999,	current: 1	},
+    entity: { schoolId: e }
+  }
+  const res = await departmentList(query)
+  const list = res?.records?.length ? res.records : []
+  item.items = list.map(e => e.entity)
+}
+
+// 获取学生基本信息
+const getStudentInfoFun = async () => {
+  const data = await getStudentInfo()
+  if (data.schoolId) getDepartmentList(data.schoolId)
+  // 回显
+  items.value.options.forEach(e => {
+    if (data[e.key]) e.value = data[e.key]
+  })
+}
+getStudentInfoFun()
+
 
 // 提交
 const handleSubmit = async () => {
   const { valid } = await CtFormRef.value.formRef.validate()
   if (!valid) return
   overlay.value = true
+  const params = {}
   items.value.options.forEach(item => {
-    query.value[item.key] = item.value
-    if (e.canBeInputted) { // 特殊处理可输入下拉框
-      dealCanBeInputtedSave(e, obj)
-    }
+    params[item.key] = item.value
   })
-  await saveStudentSimpleInfo(query.value)
+  await saveStudentSimpleInfo(params)
+  // getStudentInfoFun()
   setTimeout(async () => {
     Snackbar.success(t('common.submittedSuccessfully'))
     overlay.value = false

+ 2 - 2
src/views/register/selectedPersonRole.vue

@@ -6,11 +6,11 @@
       <div class="d-flex mt-16">
         <div style="width: 50%;" class="cursor-pointer item d-flex flex-column justify-center align-center" @click="handleClickRole(0)">
           <v-icon color="primary" size="100">mdi-account-circle-outline</v-icon>
-          <span class="color-primary" style="font-size: 24px">普通用户</span>
+          <span class="color-primary" style="font-size: 24px">职场人士</span>
         </div>
         <div style="width: 50%; border-left: 1px solid #ccc;" class="cursor-pointer item d-flex flex-column justify-center align-center" @click="handleClickRole(1)">
           <v-icon color="primary" size="100">mdi-account-school-outline</v-icon>
-          <span class="color-primary" style="font-size: 24px">学生用户</span>
+          <span class="color-primary" style="font-size: 24px">在校学生</span>
         </div>
       </div>
     </div>