Jelajahi Sumber

Merge branch 'master' of http://gogs.gisvg.com/YDM/graduate-ui

47 1 bulan lalu
induk
melakukan
16697c9f8b

+ 2 - 1
src/api/system/studentSelectSupervisorRecord/index.ts

@@ -12,7 +12,8 @@ export interface studentSelectSupervisorRecordVO {
   supervisorSignature: string // 导师电子签名
   externalSupervisorId: number // 校外导师id
   masterType:number//硕士类型
-  agreeDate:Date//同意日期
+  studentSignDate:Date//学生签字日期
+  supervisorSignDate:Date//导师签字日期
   supervisorType:string//导师类型
 }
 

+ 20 - 3
src/api/system/studentSelectSupervisorRecord/selectionBook.ts

@@ -1,6 +1,4 @@
 import request from '@/config/axios'
-import {UserProfileUpdateReqVO} from "@/api/system/user/profile";
-import {studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord/index";
 
 // 师生互选记录 VO
 export interface selectionBookVO {
@@ -14,6 +12,23 @@ export interface selectionBookVO {
   introduction: string; // 简介
   academicSlots: number; // 学硕名额
   professionalSlots: number; // 专硕名额
+  supervisorSignature:string;//导师签名
+  studentSignature:string;//学生签名
+  studentSignDate:Date;//学生签名日期
+  supervisorSignDate:Date;//学生签名日期
+}
+
+export interface printBookVO {
+  id:string;
+  studentName:string;
+  studentNumber:string;
+  major:string;
+  studentMobile :string;
+  supervisor:string;
+  supervisorType:string;
+  studentAchievementRequirement:string;
+  studentSignDate:Date
+  supervisorSignDate:Date
 }
 
 export const selectionBookApi = {
@@ -22,5 +37,7 @@ export const selectionBookApi = {
   updateSelectionBook: async (data: selectionBookVO) => {
     return await request.put({ url: `/system/student-select-supervisor-record/updateSelectionBook`, data })
   },
-
+  getSelectionBook: async (id: number) => {
+    return await request.get({ url: `/system/student-select-supervisor-record/getSelectionBook?id=`+ id })
+  },
 }

+ 5 - 0
src/api/system/studentSelectionProject/index.ts

@@ -42,4 +42,9 @@ export const studentSelectionProjectApi = {
   exportStudentSelectionProject: async (params) => {
     return await request.download({ url: `/system/student-selection-project/export-excel`, params })
   },
+
+  // 获取所有项目
+  getAllProject: async () => {
+    return await request.get({ url: `/system/student-selection-project/getAllProject`})
+  },
 }

+ 4 - 0
src/utils/download.ts

@@ -33,6 +33,10 @@ const download = {
   markdown: (data: Blob, fileName: string) => {
     download0(data, fileName, 'text/markdown')
   },
+  //新加的
+  pdf: (data: Blob, fileName: string) => {
+    download0(data, fileName, 'application/pdf')
+  },
   // 下载图片(允许跨域)
   image: ({
     url,

+ 68 - 17
src/views/system/studentSelectSupervisorRecord/index.vue

@@ -123,8 +123,7 @@
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
       <el-table-column type="index" width="50" />
-<!--      <el-table-column label="Id" align="center" prop="id" />-->
-<!--      <el-table-column label="项目id" align="center" prop="projectId" />-->
+
       <el-table-column label="学生姓名" align="center" prop="studentName" />
 
       <el-table-column label="硕士类型" align="center" prop="masterType" >
@@ -135,15 +134,25 @@
 
       <el-table-column label="专业" align="center" prop="major" />
 
-      <el-table-column label="简历" align="center" prop="introduction" />
+      <el-table-column label="学生简历" align="center" prop="introduction">
+        <template #default="scope">
+          <el-button
+            v-if="scope.row.introduction"
+            type="primary"
+            @click="handleDownload(scope.row.introduction)"
+          >
+            下载简历
+          </el-button>
+        </template>
+      </el-table-column>
 
       <el-table-column label="申请状态" align="center" prop="selectType" >
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.SYSTEM_STUDENT_SELECT_RECORD_SELECT_TYPE" :value="scope.row.selectType" />
         </template>
       </el-table-column>
-      <el-table-column label="学生电子签名" align="center" prop="studentSignature" />
-      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" />
+      <el-table-column label="学生电子签名" align="center" prop="studentSignature" v-if ="userInfo.userType==='4'" />
+      <el-table-column label="导师电子签名" align="center" prop="supervisorSignature" v-if ="userInfo.userType==='4'" />
       <el-table-column
         label="提交时间"
         align="center"
@@ -164,7 +173,7 @@
           <el-button
             link
             type="primary"
-            @click="handelAgree(scope.row.id)"
+            @click="agreeOpenForm('agree', scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
             v-hasPermi="['system:student-select-supervisor-record:agree']"
             v-if="userInfo?.userType === '3' &&scope.row.selectType ==1"
           >
@@ -181,6 +190,16 @@
             退回
           </el-button>
 
+          <el-button
+            link
+            type="primary"
+            @click="handelPrint(scope.row.id)"
+            v-hasPermi="['system:student-select-supervisor-record:getSelection']"
+            v-if="userInfo?.userType === '4' &&scope.row.selectType ==2"
+          >
+            信息
+          </el-button>
+
 <!--          <el-button-->
 <!--            link-->
 <!--            type="primary"-->
@@ -213,6 +232,7 @@
 
   <!-- 表单弹窗:添加/修改 -->
   <studentSelectSupervisorRecordForm ref="formRef" @success="getList" />
+  <studentSelectSupervisorRecordForm ref="agreeRef" @success="getList" />
 </template>
 
 <script setup lang="ts">
@@ -224,6 +244,7 @@ import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
 import {useRoute} from "vue-router";
 import {ref} from "vue";
 import { DICT_TYPE } from '@/utils/dict'
+import {selectionBookVO,printBookVO,selectionBookApi} from '@/api/system/studentSelectSupervisorRecord/selectionBook'
 
 /** 师生互选记录 列表 */
 defineOptions({ name: 'studentSelectSupervisorRecord' })
@@ -266,7 +287,8 @@ const formData = ref({
   supervisorSignature: "",
   externalSupervisorId: undefined,
   masterType:undefined,
-  agreeDate:[]//同意日期
+  studentSignDate:[],
+  supervisorSignDate:[],
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
@@ -336,18 +358,24 @@ const handleExport = async () => {
   }
 }
 
-const handelAgree = async (id:number) => {
-  console.log(id)
-  try {
-    await message.confirm()
-    formData.value.id=id
-    const data =formData.value as unknown as studentSelectSupervisorRecordVO
-    await studentSelectSupervisorRecordApi.agreeStudentSelectSupervisorRecord(data)
-    message.success("通过了申请")
-    await getList()
-  } catch {}
+
+const agreeRef = ref()
+const agreeOpenForm = (type: string, projectId?: number,supervisorId? :number,id?:number,studentId?:number) => {
+  agreeRef.value.open(type, projectId,supervisorId,id,studentId)
 }
 
+// const handelAgree = async (id:number) => {
+//   console.log(id)
+//   try {
+//     await message.confirm()
+//     formData.value.id=id
+//     const data =formData.value as unknown as studentSelectSupervisorRecordVO
+//     await studentSelectSupervisorRecordApi.agreeStudentSelectSupervisorRecord(data)
+//     message.success("通过了申请")
+//     await getList()
+//   } catch {}
+// }
+
 const handelRefuse = async (id:number) => {
   try {
     await message.confirm()
@@ -370,6 +398,29 @@ const getRecordList = async () => {
   }
 }
 
+const handleDownload = (url: string, filename: string = '学生简历') => {
+  // download.pdf(url)
+  // const link = document.createElement('a');
+  // link.href = url;
+  // link.setAttribute('download', filename);
+  // document.body.appendChild(link);
+  // link.click();
+  // document.body.removeChild(link);
+  // download.pdf(url,filename)
+  window.open(url, '_blank');
+};
+
+const handelPrint = async (id:number) => {
+  try {
+    await message.confirm()
+    const data =await selectionBookApi.getSelectionBook(id)as unknown as printBookVO
+    console.log(data)
+    message.success("获取打印信息成功")
+    await getList()
+  } catch {}
+}
+
+
 /** 初始化 **/
 onMounted(() => {
   getUserInfo()

+ 124 - 117
src/views/system/studentSelectSupervisorRecord/record.vue

@@ -1,19 +1,18 @@
 <template>
   <!-- 搜索工作栏 -->
-  <ContentWrap>
+  <ContentWrap v-if="userInfo.userType==='4'">
   <el-form
     class="-mb-15px"
     :model="queryParams"
     ref="queryFormRef"
     :inline="true"
-    label-width="68px"
+    label-width="100px"
   >
 
-
     <el-form-item label="参与导师" prop="supervisorIds">
       <el-select
         v-model="queryParams.supervisorId"
-        @change="handleSupervisorChange"
+        @change="getRecordList"
         placeholder="请选择参与导师"
         clearable
         filterable
@@ -27,104 +26,84 @@
         />
       </el-select>
     </el-form-item>
-    <!--      <el-form-item label="项目id" prop="projectId">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.projectId"-->
-    <!--          placeholder="请输入项目id"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="学生id" prop="studentId">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.studentId"-->
-    <!--          placeholder="请输入学生id"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="校内导师id" prop="supervisorId">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.supervisorId"-->
-    <!--          placeholder="请输入校内导师id"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
 
-    <!--      <el-form-item label="选择状态(0编辑(撤回),1待处理,2同意,3退回)" prop="selectType">-->
-    <!--        <el-select-->
-    <!--          v-model="queryParams.selectType"-->
-    <!--          placeholder="请选择选择状态(0编辑(撤回),1待处理,2同意,3退回)"-->
-    <!--          clearable-->
-    <!--          class="!w-240px"-->
-    <!--        >-->
-    <!--          <el-option label="请选择字典生成" value="" />-->
-    <!--        </el-select>-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="学生电子签名" prop="studnetSignature">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.studnetSignature"-->
-    <!--          placeholder="请输入学生电子签名"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="创建时间" prop="createTime">-->
-    <!--        <el-date-picker-->
-    <!--          v-model="queryParams.createTime"-->
-    <!--          value-format="YYYY-MM-DD HH:mm:ss"-->
-    <!--          type="daterange"-->
-    <!--          start-placeholder="开始日期"-->
-    <!--          end-placeholder="结束日期"-->
-    <!--          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
-    <!--          class="!w-220px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="导师审批时间" prop="supervisorApproveTime">-->
-    <!--        <el-date-picker-->
-    <!--          v-model="queryParams.supervisorApproveTime"-->
-    <!--          value-format="YYYY-MM-DD HH:mm:ss"-->
-    <!--          type="daterange"-->
-    <!--          start-placeholder="开始日期"-->
-    <!--          end-placeholder="结束日期"-->
-    <!--          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
-    <!--          class="!w-220px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="导师电子签名" prop="supervisorSignature">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.supervisorSignature"-->
-    <!--          placeholder="请输入导师电子签名"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="校外导师id" prop="externalSupervisorId">-->
-    <!--        <el-input-->
-    <!--          v-model="queryParams.externalSupervisorId"-->
-    <!--          placeholder="请输入校外导师id"-->
-    <!--          clearable-->
-    <!--          @keyup.enter="handleQuery"-->
-    <!--          class="!w-240px"-->
-    <!--        />-->
-    <!--      </el-form-item>-->
+    <el-form-item label="请选择项目" prop="projectId">
+      <el-select
+        v-model="queryParams.projectId"
+        @change="getRecordList"
+        placeholder="请选择项目"
+        clearable
+        filterable
+        class="!w-240px"
+      >
+        <el-option
+          v-for="project in projects"
+          :key="project.id"
+          :label="project.projectName"
+          :value="project.id"
+        />
+      </el-select>
+    </el-form-item>
+
+    <el-form-item label="参与学生年级" prop="studentGrade">
+      <el-select
+        v-model="queryParams.studentGrade"
+        placeholder="请选择参与学生年级"
+        clearable
+        @change="handleQuery"
+        class="!w-240px"
+      >
+        <el-option
+          v-for="year in gradeOptions"
+          :key="year"
+          :label="year"
+          :value="year"
+        />
+      </el-select>
+    </el-form-item>
+
+          <el-form-item label="学生姓名" v-if="userInfo.userType==='4'">
+            <el-input
+              v-model="queryParams.studentName"
+              placeholder="请输入学生名称"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+
+          <el-form-item label="选择状态" prop="selectType">
+            <el-select
+              v-model="queryParams.selectType"
+              @change="getRecordList"
+              placeholder="请选择选择状态"
+              clearable
+              class="!w-240px"
+            >
+              <el-option label="撤回" value="0" />
+              <el-option label="待处理" value="1" />
+              <el-option label="同意" value="2" />
+              <el-option label="退回" value="3" />
+              <el-option label="志愿编辑" value="4" />
+            </el-select>
+          </el-form-item>
+
+<!--          <el-form-item label="创建时间" prop="createTime">-->
+<!--            <el-date-picker-->
+<!--              v-model="queryParams.createTime"-->
+<!--              value-format="YYYY-MM-DD HH:mm:ss"-->
+<!--              type="daterange"-->
+<!--              start-placeholder="开始日期"-->
+<!--              end-placeholder="结束日期"-->
+<!--              :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
+<!--              class="!w-220px"-->
+<!--            />-->
+<!--          </el-form-item>-->
+
     <el-form-item>
               <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
               <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
-      <!--        <el-button-->
-      <!--          type="primary"-->
-      <!--          plain-->
-      <!--          @click="openForm('create')"-->
-      <!--          v-hasPermi="['system:student-select-supervisor-record:create']"-->
-      <!--        >-->
-      <!--          <Icon icon="ep:plus" class="mr-5px" /> 新增-->
-      <!--        </el-button>-->
+
       <el-button
         type="success"
         plain
@@ -137,7 +116,8 @@
     </el-form-item>
   </el-form>
   </ContentWrap>
-  <!--  是学生-->
+
+  <!---->
   <ContentWrap v-if="userInfo.userType==='1' ||userInfo.userType==='4'" >
       <el-table
         v-loading="loading"
@@ -145,6 +125,7 @@
         row-key="id"
       >
       <el-table-column type="index" width="50" />
+        <el-table-column label="项目名称" align="center" prop="projectName" />
       <el-table-column label="学生姓名" align="center" prop="studentName" />
       <el-table-column label="硕士类型" align="center" prop="masterType" >
         <template #default="scope">
@@ -188,7 +169,7 @@
             <el-button
               link
               type="primary"
-              @click="openForm('update',  scope.row.projectId,scope.row.supervisorId,scope.row.id)"
+              @click="openForm('update',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
               v-hasPermi="['system:student-select-supervisor-record:update']"
             >
               志愿编辑
@@ -197,6 +178,12 @@
         </el-table-column>
     </el-table>
 
+    <Pagination
+      :total="total"
+      v-model:page="queryParams.pageNo"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getRecordList"
+    />
   </ContentWrap>
   <!-- 表单弹窗:添加/修改 -->
   <studentSelectSupervisorRecordForm ref="formRef" @success="getRecordList" />
@@ -210,12 +197,10 @@ import download from '@/utils/download'
 import { supervisorSelectionSettingApi, supervisorSelectionSettingVO } from '@/api/system/supervisorSelectionSetting'
 import * as UserApi from '@/api/system/user'
 import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
-import {
-  studentSelectSupervisorRecordApi,
-  studentSelectSupervisorRecordVO
-} from "@/api/system/studentSelectSupervisorRecord";
+import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
 import {DICT_TYPE} from "@/utils/dict";
 import studentSelectSupervisorRecordForm from './studentSelectSupervisorRecordForm.vue'
+import {studentSelectionProjectApi} from "@/api/system/studentSelectionProject"
 
 /** 导师学硕专硕名额设置 列表 */
 defineOptions({ name: 'recordList' })
@@ -230,11 +215,13 @@ const queryParams = reactive({
   pageSize: 10,
   projectId: undefined,
   supervisorId: undefined,
-  academicSlots: undefined,
-  professionalSlots: undefined,
-  supervisorName:undefined,
+  externalSupervisorId:undefined,
+  supervisor:undefined,
   userType:undefined,
+  studentName:"",
   createTime: [],
+  projectName:"",
+  studentGrade:""
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
@@ -271,8 +258,8 @@ const resetQuery = () => {
 
 /** 添加/修改操作 */
 const formRef = ref()
-const openForm = (type: string, projectId?: number,supervisorId? :number,id?:number) => {
-  formRef.value.open(type, projectId,supervisorId,id)
+const openForm = (type: string, projectId?: number,supervisorId? :number,id?:number,studentId?:number) => {
+  formRef.value.open(type, projectId,supervisorId,id,studentId)
 }
 
 const recordData = ref({
@@ -286,7 +273,8 @@ const recordData = ref({
   supervisorSignature: "",
   externalSupervisorId: undefined,
   masterType:undefined,
-  agreeDate:[]//同意日期
+  studentSignDate:[],
+  supervisorSignDate:[],
 })
 
 const selectionList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选择记录列表
@@ -294,8 +282,10 @@ const selectionList = ref<studentSelectSupervisorRecordVO[]>([]) //下面的选
 const getRecordList = async () => {
   loading.value = true
   try {
-    const data = await studentSelectSupervisorRecordApi.getSelectSupervisorRecordList(queryParams)
+    const data = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecordPage(queryParams)
     selectionList.value = data
+    selectionList.value = data.list
+    total.value = data.total
   } finally {
     loading.value = false
   }
@@ -310,19 +300,36 @@ const getSupervisor= async () => {
     console.error('未获取到导师', error)
   }
 }
+
 //传supervisorId给formData.supervisorId
-const handleSupervisorChange = (value: number) => {
-  const selectedUser = users.value.find(user => user.id === value);
-  if (selectedUser) {
-    formData.value.supervisorId = selectedUser.id;
-    formData.value.supervisor = selectedUser.nickname;
-  }
+const handleSupervisorChange = () => {
+
 }
 
+const currentYear = new Date().getFullYear(); // 获取当前年份
+const gradeOptions = computed(() => {
+  return [
+    currentYear + '级',         // 今年
+    currentYear - 1 + '级',     // 去年
+    currentYear - 2 + '级',     // 前年
+    currentYear - 3 + '级',     // 大前年
+    currentYear - 4 + '级',     // 大大前年
+  ];
+});
+
+const projects = ref()
+const getAllProject= async () => {
+  try {
+    projects.value = await studentSelectionProjectApi.getAllProject()
+  } catch (error) {
+    console.error('未获取到项目', error)
+  }
+}
 /** 初始化 **/
 onMounted(() => {
   getUserInfo()
   getRecordList()
+  getAllProject()
   getSupervisor()
 })
 </script>

+ 179 - 80
src/views/system/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue

@@ -1,75 +1,90 @@
 <template>
-  <Dialog :title="dialogTitle" v-model="dialogVisible">
+  <Dialog :title="dialogTitle" v-model="dialogVisible" class="mutual-selection-dialog">
+    <div class="header">
+      <h3>师生互选表</h3>
+    </div>
     <el-form
       ref="formRef"
       :model="formData"
       :rules="formRules"
-      label-width="100px"
+      label-width="120px"
       v-loading="formLoading"
+      class="form-container"
     >
-      <el-row v-if="formType === 'create'" :disabled=!isSupervisor>
-        <el-col :span="12" >
-          <el-form-item label="导师姓名" prop="nickname">
-            <el-input v-model="formData.nickname" placeholder="请输入姓名" :disabled=!isSupervisor />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12" v-if="formType === 'create'">
-          <el-form-item label="职称" prop="title">
-            <el-input v-model="formData.title"  :disabled=!isSupervisor />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-row  v-if="formType === 'create'" >
-        <el-col :span="12">
-          <el-form-item label="研究方向" prop="major">
-            <el-input v-model="formData.major" placeholder="导师暂未填写" :disabled=!isSupervisor />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-row v-if="formType === 'create'" :disabled=false>
-        <el-col :span="24">
-          <el-form-item label="对研究生毕业的成果要求" prop="studentAchievementRequirement" type="create">
-            <el-input v-model="formData.studentAchievementRequirement" placeholder="导师暂未填写" class="!h-200px" :disabled=!isSupervisor />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-form-item label="选择导师" prop="supervisorId" v-if="formType === 'update'">
-        <el-select
-          v-model="formData.supervisorId"
-          @change="handleSupervisorChange"
-          placeholder="请选择导师"
-          clearable
-          filterable
-          class="!w-240px"
-        >
-          <el-option
-            v-for="supervisor in supervisors"
-            :key="supervisor.id"
-            :label="supervisor.nickname"
-            :value="supervisor.id"
-          />
-        </el-select>
-      </el-form-item>
-
-      <!-- 学生电子签名 -->
-<!--      <el-form-item label="学生电子签名" prop="studentSignature" v-if="">-->
-<!--        <vue-esign ref="studentSignaturePad" :width="400" :height="200" @save="handleStudentSignatureSave" />-->
-<!--      </el-form-item>-->
-
-<!--      &lt;!&ndash; 导师电子签名 &ndash;&gt;-->
-<!--      <el-form-item label="导师电子签名" prop="supervisorSignature">-->
-<!--        <vue-esign ref="supervisorSignaturePad" :width="400" :height="200" @save="handleSupervisorSignatureSave" />-->
-<!--      </el-form-item>-->
+      <!-- 学生信息 -->
+      <div class="section"  v-if="userInfo.userType==='4' ||userInfo.userType==='3'" >
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="学生姓名">
+              <el-input v-model="studentData.nickname" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="学号">
+              <el-input v-model="studentData.userNumber" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="专业">
+              <el-input v-model="studentData.major" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="联系电话">
+              <el-input v-model="studentData.mobile" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
 
+      <!-- 学生志愿 -->
+      <div class="section">
+        <h4>学生志愿</h4>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="导师姓名">
+              <el-input v-model="supervisorData.nickname" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="校内导师">
+              <el-input v-model="supervisorData.title" placeholder="自动链接" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="对研究生毕业时学术成果的要求">
+              <el-input type="textarea" v-model="supervisorData.studentAchievementRequirement" placeholder="(未填写时,默认学校及学院发表学术成果的需求执行)" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="志愿填报">
+              <p>本人已知晓{{supervisorData.nickname}}对研究生毕业时学术成果的发表要求,特申请加入{{supervisorData.nickname}}课题组进行研究生阶段的学习和研究。</p>
+              <p v-if="userInfo.userType=='1'">★ 本人签字 <el-input v-model="formData.studentSignature" placeholder="" /></p>
+              <p v-if="userInfo.userType==='3'|| userInfo.userType==='4'">★ 本人签字 <el-input v-model="formData.studentSignature" placeholder="" disabled/></p>
+              <p v-if="userInfo.userType==='3'|| userInfo.userType==='4'">日期:{{formData.studentSignDate}}</p>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+
+      <!-- 导师意见 -->
+      <div class="section" v-if="userInfo.userType==='4'||userInfo.userType==='3'">
+        <p>导师意见:同意</p>
+        <p>导师签字 <el-input v-model="formData.supervisorSignature" placeholder="" /></p>
+        <p v-if="userInfo.userType==='4'">日期:{{formData.supervisorSignDate}}</p>
+      </div>
+
+<!--      <template #footer>-->
+        <el-button @click="submitForm" type="primary" :disabled="formLoading">确认填报</el-button>
+        <el-button @click="dialogVisible = false">取消</el-button>
+<!--      </template>-->
     </el-form>
-    <template #footer>
-      <el-button @click="submitForm" type="primary" :disabled="formLoading">确认填报</el-button>
-      <el-button @click="dialogVisible = false">取 消</el-button>
-<!--      <button @click="saveSupervisorSignature">保存签名</button>-->
-    </template>
   </Dialog>
 </template>
 
@@ -102,7 +117,11 @@ const formData = ref({
   supervisorApproveTime: undefined,
   supervisorSignature: "",
   externalSupervisorId: undefined,
+  studentSignDate:[],
+  supervisorSignDate:[],
+})
 
+const supervisorData = ref({
   //导师的信息
   nickname: '',
   remark: ' ',
@@ -110,6 +129,14 @@ const formData = ref({
   studentAchievementRequirement:"",
   title:""
 })
+
+const studentData = ref({
+  //导师的信息
+  nickname: "",
+  userNumber:"",
+  major:"",
+  mobile:"",
+})
 const formRules = reactive({
   // projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
   // studentId: [{ required: true, message: '学生id不能为空', trigger: 'blur' }],
@@ -126,7 +153,7 @@ const getUserInfo = async () => {
 
 /** 打开弹窗 */
 
-const open = async (type: string, projectId?: number ,supervisorId?:number) => {
+const open = async (type: string, projectId?: number ,supervisorId?:number, id?:number,studentId?:number) => {
   dialogVisible.value = true
   if (type === 'create'){
     dialogTitle.value = '志愿填报'
@@ -137,15 +164,16 @@ const open = async (type: string, projectId?: number ,supervisorId?:number) => {
       try {
         console.log(supervisorId)
         console.log(projectId)
-        const user = await supervisorSelectionSettingApi.getSupervisorInfo(supervisorId,projectId);
-        // formData.value = await studentSelectSupervisorRecordApi.getstudentSelectSupervisorRecord(id)
-        console.log(user)
+        const supervisor = await supervisorSelectionSettingApi.getSupervisorInfo(supervisorId,projectId);
+        //需要传的
         formData.value.supervisorId =supervisorId;
         formData.value.projectId = projectId;
-        formData.value.nickname = user.supervisorName;
-        formData.value.title =user.title;
-        formData.value.studentAchievementRequirement = user.studentAchievementRequirement;
-        formData.value.major = user.major;
+
+        //显示的
+        supervisorData.value.nickname = supervisor.supervisorName;
+        supervisorData.value.title =supervisor.title;
+        supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
+        supervisorData.value.major = supervisor.major;
       } finally {
         formLoading.value = false
       }
@@ -159,7 +187,32 @@ const open = async (type: string, projectId?: number ,supervisorId?:number) => {
       formLoading.value = true
       try {
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
-        console.log(formData.value)
+      } finally {
+        formLoading.value = false
+      }
+    }
+  }
+  if (type === 'agree'){
+    dialogTitle.value = '通过志愿'
+    formType.value = type
+    resetForm()
+    if (studentId) {
+      formLoading.value = true
+      try {
+        const result =await UserApi.getUser(studentId)
+        studentData.value.nickname=result.nickname
+        studentData.value.userNumber=result.userNumber
+        studentData.value.major=result.major
+        studentData.value.mobile=result.mobile
+
+        const supervisor = await supervisorSelectionSettingApi.getSupervisorInfo(supervisorId,projectId);
+        //显示的
+        supervisorData.value.nickname = supervisor.supervisorName;
+        supervisorData.value.title =supervisor.title;
+        supervisorData.value.studentAchievementRequirement = supervisor.studentAchievementRequirement;
+        supervisorData.value.major = supervisor.major;
+
+        formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
       } finally {
         formLoading.value = false
       }
@@ -182,22 +235,19 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 /** 提交表单 */
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 const submitForm = async () => {
-  await formRef.value.validate();
-
-  // 在提交前检查签名数据
-  // if (!formData.value.studentSignature) {
-  //   message.warning("请签署学生电子签名!");
-  //   return;
-  // }
   formLoading.value = true;
   try {
     const data = formData.value as unknown as studentSelectSupervisorRecordVO;
+    console.log(data)
     if (formType.value === 'create') {
       await studentSelectSupervisorRecordApi.createStudentSelectSupervisorRecord(data);
       message.success(t('common.createSuccess'));
-    } else {
+    } else if (formType.value === 'update') {
       await studentSelectSupervisorRecordApi.updateStudentSelectSupervisorRecord(data);
       message.success(t('common.updateSuccess'));
+    } else if (formType.value === 'agree') {
+      await studentSelectSupervisorRecordApi.agreeStudentSelectSupervisorRecord(data);
+      message.success("已经同意申请");
     }
     dialogVisible.value = false;
     emit('success');
@@ -247,7 +297,56 @@ onMounted(() => {
 </script>
 
 <style scoped>
+.mutual-selection-dialog {
+  width: 600px;
+  border-radius: 8px;
+  overflow: hidden;
+}
+
+.header {
+  background-color: #f5f5f5;
+  padding: 10px;
+  text-align: center;
+  border-bottom: 1px solid #e0e0e0;
+}
+
+.form-container {
+  padding: 20px;
+}
+
+.section {
+  border: 1px solid #e0e0e0;
+  border-radius: 4px;
+  margin-bottom: 20px;
+  padding: 15px;
+  background-color: #fcfcfc;
+}
+
+.section h4 {
+  margin-top: 0;
+  color: #333;
+}
 
+.el-form-item {
+  margin-bottom: 20px;
+}
 
+.el-input {
+  width: 100%;
+}
+
+.el-button {
+  margin-right: 10px;
+}
+
+.el-button[type="primary"] {
+  background-color: #409EFF;
+  border-color: #409EFF;
+}
+
+.el-button[type="primary"]:hover {
+  background-color: #66b1ff;
+  border-color: #66b1ff;
+}
 </style>
 

+ 9 - 14
src/views/system/supervisorSelectionSetting/index.vue

@@ -12,7 +12,6 @@
       <el-form-item label="参与导师" prop="supervisorIds">
         <el-select
           v-model="queryParams.supervisorId"
-          @change="handleSupervisorChange"
           placeholder="请选择参与导师"
           clearable
           filterable
@@ -139,13 +138,14 @@
           </el-button>
         </template>
       </el-table-column>
+
       <!--  学生志愿填报-->
       <el-table-column label="志愿填报" align="center" min-width="120px"  v-if=" userInfo?.userType === '1'">
         <template #default="scope">
           <el-button
             type="primary"
             link
-            @click="openStudentSelectSupervisorPop('create', scope.row.projectId,scope.row.supervisorId)"
+            @click="openStudentSelectSupervisorPop('create', scope.row.projectId,scope.row.supervisorId,null,null)"
             v-hasPermi="['system:student-select-supervisor-record:create']"
             v-if="userInfo?.userType === '1'"
           >
@@ -155,6 +155,7 @@
         </template>
       </el-table-column>
 
+
       <el-table-column label="操作" align="center" min-width="120px">
         <template #default="scope">
 <!--          学院查看招生详情-->
@@ -397,13 +398,6 @@ const getSupervisor= async () => {
   }
 }
 //传supervisorId给formData.supervisorId
-const handleSupervisorChange = (value: number) => {
-  const selectedUser = users.value.find(user => user.id === value);
-  if (selectedUser) {
-    formData.value.supervisorId = selectedUser.id;
-    formData.value.supervisor = selectedUser.nickname;
-  }
-}
 
 const teacherRequireFormRef = ref()
 const openTeacherRequireForm = (supervisorId?: number) => {
@@ -412,8 +406,8 @@ const openTeacherRequireForm = (supervisorId?: number) => {
 
 //志愿填报弹窗
 const studentSelectSupervisorPop= ref()
-const openStudentSelectSupervisorPop =  (type: string, projectId?: number,supervisorId? :number) => {
-  studentSelectSupervisorPop.value.open(type, projectId ,supervisorId)
+const openStudentSelectSupervisorPop =  (type: string, projectId?: number,supervisorId? :number,id:number,studentId:number) => {
+  studentSelectSupervisorPop.value.open(type, projectId ,supervisorId,id,studentId)
 }
 
 //没处理好
@@ -429,7 +423,8 @@ const recordData = ref({
   supervisorSignature: "",
   externalSupervisorId: undefined,
   masterType:undefined,
-  agreeDate:[]//同意日期
+  studentSignDate:[],
+  supervisorSignDate:[],
 })
 const handelWithdraw = async (supervisorId:number) => {
   try {
@@ -455,10 +450,10 @@ const getRecordList = async () => {
 }
 
 /** 初始化 **/
-onMounted(() => {
+onMounted(async () => {
   getList()
   getUserInfo()
   getSupervisor()
-  getRecordList()
+  await getRecordList()
 })
 </script>

+ 7 - 2
src/views/system/userDetail/teacher.vue

@@ -187,8 +187,13 @@ const isSupervisor = computed(() => userInfo.value.userType === '3');
 
 //下载PDF
 const handleDownload = () => {
-  console.log(formData.value.introduction)
-  download.markdown(formData.value.introduction, '个人简历.pdf');
+  // const link = document.createElement('a');
+  // link.href = url;
+  // link.setAttribute('download', filename);
+  // document.body.appendChild(link);
+  // link.click();
+  // document.body.removeChild(link);
+  window.open(formData.value.introduction, '_blank');
 };