47 пре 2 недеља
родитељ
комит
242c2b25e6

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

@@ -78,8 +78,8 @@ export const studentSelectSupervisorRecordApi = {
   },
   
   // 获取导师的最近一次的签名
-  getSupervisorSignature: async (id: number) => {
-    return await request.get({ url: `/system/student-select-supervisor-record/getSupervisorSignature?id=` + id })
+  getSupervisorSignature: async () => {
+    return await request.get({ url: `/system/student-select-supervisor-record/getSupervisorSignature` })
   },
 
   // 获得待审批记录分页 

+ 2 - 2
src/api/system/studentSelectionProject/index.ts

@@ -49,8 +49,8 @@ export const studentSelectionProjectApi = {
   },
 
   // 获取当前项目的导师 
-  getProjectSupervisors: async (projectId: number) => {
-    return await request.get({ url: `/system/student-selection-project/getProjectSupervisors`, params: { projectId: projectId }})
+  getProjectSupervisors: async () => {
+    return await request.get({ url: `/system/student-selection-project/getProjectSupervisors`})
   },
 
 }

+ 1 - 1
src/views/system/studentSelection/studentSelectSupervisorRecord/index.vue

@@ -388,7 +388,7 @@ const agreeOpenForm = (type: string, projectId?: number,supervisorId? :number,id
 const handelRefuse = async (id:number) => {
   try {
     await message.confirm("是否确定退回申请?")
-    formData.value.id=id
+    formData.value.id = id
     const data =formData.value as unknown as studentSelectSupervisorRecordVO
     await studentSelectSupervisorRecordApi.refuseStudentSelectSupervisorRecord(data)
     message.success("拒绝了申请")

+ 102 - 33
src/views/system/studentSelection/studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue

@@ -81,8 +81,8 @@
                   style="border:1px solid #e0e0e0; border-radius: 4px; background-color: white;"
                 ></canvas>
                 <div style="display: flex; justify-content: flex-end;">
-                  <button type="button" @click="handleStudentSignatureSave" style="padding: 2px 5px; margin-right: 10px;">保存</button>
-                  <button type="button" @click="ClearStudentSignature" style="padding: 2px 5px;">清空</button>
+                  <el-button type="primary" @click="handleStudentSignatureSave" size="small">保存</el-button>
+                  <el-button  @click="ClearStudentSignature" size="small">清空</el-button>
                 </div>
               </div>
               <p v-if="userInfo.userType==='3' || formType === 'end'">★ 本人签字</p>
@@ -96,20 +96,33 @@
       <div class="section" v-if="userInfo.userType==='3'">
         <p style="margin-bottom: 10px;">导师意见:同意</p>
         <p style="margin-bottom: 10px;">导师签字</p>
-        <div>
+        <div v-show="lastSupervisorSignature">
+          <img :src="formData.supervisorSignature" alt="导师签名" style="width: 300px; height: 100px; margin-right: 10px; background-color: white;"/>
+          <div style="margin-top: 10px;">
+            <el-button 
+              plain
+              type="primary" 
+              size="small"
+              @click="handleResign"
+            >
+              重签
+            </el-button>
+          </div>
+        </div>
+        <div v-show="!lastSupervisorSignature">
           <canvas 
             id="canvas" 
             ref="canvas" 
-            width="400px" 
-            height="100px" 
+            width="400" 
+            height="100" 
             @mousedown="handleMouseDown"
             @mousemove="handleMouseMove"
             @mouseup="handleMouseUp"
             style="border:1px solid #e0e0e0; border-radius: 4px; background-color: white;"
           ></canvas>
           <div style="display: flex; justify-content: flex-start; margin-top: 10px;">
-            <button type="button" @click="handleSupervisorSignatureSave" style="padding: 2px 5px; margin-right: 10px;">保存</button>
-            <button type="button" @click="ClearSupervisorSignature" style="padding: 2px 5px;">清空</button>
+            <el-button type="primary" @click="handleSupervisorSignatureSave" size="small">保存</el-button>
+            <el-button  @click="ClearStudentSignature" size="small">清空</el-button>
           </div>
         </div>
         <!-- <p v-if="userInfo.userType==='4'">日期:{{formData.supervisorSignDate}}</p> -->
@@ -119,7 +132,7 @@
         <img :src="formData.supervisorSignature" alt="导师签名" style="width: 300px; height: 100px; margin-right: 10px; background-color: white;"/>
         <p>日期:{{formattedSupervisorSignDate}}</p>
       </div>
-      <div class="section" v-if="userInfo.userType==='4' && formType === 'update'">
+      <div class="section" v-if="userInfo.userType==='4' && formType === 'update' || userInfo.userType==='4' && formType === 'updatetwo' || userInfo.userType==='4' && formType === 'updateone'">
         <el-form-item label="参与导师" prop="supervisorId">
           <el-select
             v-model="formData.supervisorId"
@@ -157,9 +170,9 @@ import {supervisorSelectionSettingApi} from '@/api/system/supervisorSelectionSet
 import { htmlPdf } from "@/utils/htmlToPDF.js"  
 import { studentSelectionProjectApi, studentSelectionProjectVO } from '@/api/system/studentSelectionProject'
 
-
 /** 师生互选记录 表单 */
 defineOptions({ name: 'StudentSelectSupervisorRecordForm' })
+const canvas = ref();
 
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
@@ -232,6 +245,7 @@ const userInfo = ref({} as ProfileVO)
 const getUserInfo = async () => {
   const users = await getUserProfile()
   userInfo.value = users
+  // console.log('userInfo', userInfo.value);
 }
 
 // 获取所有导师
@@ -246,10 +260,29 @@ const getSupervisor= async () => {
   }
 }
 
+const lastSupervisorSignature = ref();
+// 获取上一次的签名
+const getSupervisorSignature = async() => {
+  const res = await studentSelectSupervisorRecordApi.getSupervisorSignature()
+  // console.log(res,'r4es');
+  lastSupervisorSignature.value = res
+  // console.log(lastSupervisorSignature.value,'lastSupervisorSignature.value');
+}
+
 const showPrintButton = ref(false); // 控制打印按钮的显示
 /** 打开弹窗 */
 const open = async (type: string, projectId?: number, supervisorId?:number, id?:number, studentId?:number) => {
   dialogVisible.value = true;
+  await nextTick(() => {
+    if (canvas.value) {
+      context.value = canvas.value.getContext('2d');
+      context.value.lineWidth = 2; // 设置线条宽度
+      context.value.lineCap = 'round'; // 设置线条末端样式
+      context.value.strokeStyle = 'black'; // 设置线条颜色
+    } else {
+      console.error('Canvas element is not found');
+    }
+  })
   if (type === 'create'){
     dialogTitle.value = '志愿填报'
     submitFormText.value = '选择'
@@ -288,7 +321,6 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         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;
@@ -298,6 +330,9 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         supervisorData.value.workSupervisor = supervisor.workSupervisor;
         
         formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
+        await getSupervisorSignature();
+        formData.value.supervisorSignature = lastSupervisorSignature.value
+        // console.log(formData.value.supervisorSignature,'formData.value.supervisorSignature');
       } finally {
         formLoading.value = false
       }
@@ -358,7 +393,30 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
       }
     }
     
-    await getProjectSupervisors(projectId)
+    await getProjectSupervisors()
+    
+  }
+  if (type === 'updateone'){
+    dialogTitle.value = '志愿编辑'
+    submitFormText.value = '编辑'
+    formType.value = type
+    resetForm()
+    if (id) {
+      formLoading.value = true
+      try {
+        const result =await UserApi.getUser(id)
+        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);
+        formData.value = await studentSelectSupervisorRecordApi.getStudentSelectSupervisorRecord(id)
+      } finally {
+        formLoading.value = false
+      }
+    }
+    
+    await getProjectSupervisors()
     
   }
   if (type === 'updatetwo'){
@@ -375,15 +433,14 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
         formLoading.value = false
       }
     }
-    if (studentId) {
+    if (id) {
       formLoading.value = true
       try {
-        const result =await UserApi.getUser(studentId)
+        const result =await UserApi.getUser(id)
         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;
@@ -397,7 +454,7 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
       }
     }
     
-    await getProjectSupervisors(projectId)
+    await getProjectSupervisors()
   }
   if (type === 'end'){
     dialogTitle.value = '详情'
@@ -433,23 +490,15 @@ const open = async (type: string, projectId?: number, supervisorId?:number, id?:
       }
     }
   }
-  await nextTick();
-  if (canvas.value) {
-    context.value = canvas.value.getContext('2d');
-    context.value.lineWidth = 2; // 设置线条宽度
-    context.value.lineCap = 'round'; // 设置线条末端样式
-    context.value.strokeStyle = 'black'; // 设置线条颜色
-  } else {
-    console.error('Canvas element is not found');
-  }
+  
 }
 
 // 获取当前项目的导师
 const supervisorsin = ref()
-const getProjectSupervisors = async (projectId: number) => {
-  console.log('请求的项目ID:', projectId);
-  const result = await studentSelectionProjectApi.getProjectSupervisors(projectId);
-  console.log(result,'获取到的导师信息');
+const getProjectSupervisors = async () => {
+  // console.log('请求的项目ID:', projectId);
+  const result = await studentSelectionProjectApi.getProjectSupervisors();
+  // console.log(result,'获取到的导师信息');
   supervisorsin.value = result
 }
 
@@ -459,9 +508,7 @@ const handleExport = (row) => {
   htmlPdf(fileName, formElement, row);
   dialogVisible.value = false;
 };
-defineExpose({ open, handleExport });
-
-const canvas = ref() // 签名画布
+ 
 const isDrawing = ref(false) // 是否正在画
 const context = ref() // 签名画布的上下文
 
@@ -498,6 +545,24 @@ const handleMouseUp = () => {
   isDrawing.value = false
 }
 
+// 重签
+const handleResign = async () => {
+  formData.value.supervisorSignature = ''; // 清空当前签名
+  lastSupervisorSignature.value = ''; // 清空历史签名
+  ClearSupervisorSignature(); // 清空签名画布
+  console.log(canvas.value,'canvas.value')
+  if (canvas.value) {
+    context.value = canvas.value.getContext('2d'); // 获取上下文
+    context.value.clearRect(0, 0, canvas.value.width, canvas.value.height); // 清空画布
+    context.value.lineWidth = 2; // 设置线条宽度
+    context.value.lineCap = 'round'; // 设置线条末端样式
+    context.value.strokeStyle = 'black'; // 设置线条颜色
+    message.success('导师签名已重置');
+  } else {
+    console.error('Canvas element is not found');
+  }
+};
+
 const ClearStudentSignature = () => {
   if (context.value) {
     formData.value.studentSignature = "";
@@ -520,7 +585,7 @@ const handleStudentSignatureSave = () => {
 };
 
 const ClearSupervisorSignature = () => {
-  if (context.value) {
+  if (canvas.value && context.value) {
     formData.value.supervisorSignature = "";
     context.value.clearRect(0, 0, canvas.value.width, canvas.value.height);
     message.success('签名已清空');
@@ -591,6 +656,7 @@ const isSupervisor = computed(() => userInfo.value.userType === '3');
 const handleSupervisorChange = (supervisorId?:number) => {
   supervisorId = supervisors.value.id;
 }
+defineExpose({ open, handleExport });
 
 /** 重置表单 */
 const resetForm = () => {
@@ -609,9 +675,12 @@ const resetForm = () => {
 }
 
 /** 初始化 **/
-onMounted(() => {
+onMounted( async () => {
   getSupervisor()
   getUserInfo()
+  if (userInfo.value.userType === '3'){
+    await getSupervisorSignature()
+  }
 })
 </script>
 

+ 2 - 2
src/views/system/studentSelection/studentSelectionNo/index.vue

@@ -98,7 +98,7 @@
           <!-- 待处理 -->
           <el-button
             type="text"
-            @click="openForm('update',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
+            @click="openForm('updateone',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
             v-hasPermi="['system:student-select-supervisor-record:update']"
             v-if="scope.row.selectStatus === 1"
           >
@@ -107,7 +107,7 @@
           <!-- 未提交 -->
           <el-button
             type="text"
-            @click="openForm('updatetwo',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
+            @click="openForm('updatetwo',  scope.row.projectId,scope.row.supervisorId,scope.row.id)"
             v-hasPermi="['system:student-select-supervisor-record:update']"
             v-if="scope.row.selectStatus === 0"
           >

+ 39 - 0
src/views/system/studentSelection/studentSelectionWait/index.vue

@@ -117,8 +117,30 @@
         :formatter="dateFormatter"
         width="180px"
       />
+      <el-table-column label="操作" align="center" min-width="120px">
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            @click="agreeOpenForm('agree', scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
+            v-hasPermi="['system:student-select-supervisor-record:agree']"
+          >
+            通过
+          </el-button>
+
+          <el-button
+            link
+            type="danger"
+            @click="handelRefuse(scope.row.id)"
+            v-hasPermi="['system:student-select-supervisor-record:refuse']"
+          >
+            退回
+          </el-button>
+        </template>
+      </el-table-column>
     </el-table>
   </ContentWrap>
+  <studentSelectSupervisorRecordForm ref="agreeRef" @success="getWaitList" />
 </template>
 
 <script setup lang="ts">
@@ -128,6 +150,7 @@ import { dateFormatter } from '@/utils/formatTime'
 import {studentSelectSupervisorRecordApi, studentSelectSupervisorRecordVO} from "@/api/system/studentSelectSupervisorRecord";
 import {studentSelectionProjectApi, studentSelectionProjectVO} from "@/api/system/studentSelectionProject"
 import * as UserApi from '@/api/system/user'
+import studentSelectSupervisorRecordForm from "../studentSelectSupervisorRecord/studentSelectSupervisorRecordForm.vue"
 
 defineOptions({ name: 'StudentSelectionWait' })
 
@@ -207,6 +230,22 @@ const resetQuery = () => {
   handleQuery()
 }
 
+const handelRefuse = async (id:number) => {
+  try {
+    await message.confirm("是否确定退回申请?")
+    queryForm.value.id = id
+    const data = queryForm.value as unknown as studentSelectSupervisorRecordVO
+    await studentSelectSupervisorRecordApi.refuseStudentSelectSupervisorRecord(data)
+    message.success("拒绝了申请")
+    await getWaitList()
+  } catch {}
+}
+
+const agreeRef = ref()
+const agreeOpenForm = (type: string, projectId?: number,supervisorId? :number,id?:number,studentId?:number) => {
+  agreeRef.value.open(type, projectId,supervisorId,id,studentId)
+}
+
 
 onMounted(() => {
   getWaitList()

+ 1 - 1
src/views/system/studentSelection/studentSelectionYes/index.vue

@@ -117,7 +117,7 @@
         <template #default="scope">
           <el-button
             type="text"
-            @click="openForm('update',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
+            @click="openForm('updateone',  scope.row.projectId,scope.row.supervisorId,scope.row.id,scope.row.studentId)"
             v-hasPermi="['system:student-select-supervisor-record:update']"
           >
             志愿编辑

+ 1 - 1
src/views/system/supervisorSelectionSetting/index.vue

@@ -423,7 +423,7 @@ const getUser = async () => {
 //志愿填报弹窗
 const studentSelectSupervisorPop= ref()
 const openStudentSelectSupervisorPop =  (id:number,studentId:number,type: string, projectId?: number,supervisorId? :number) => {
-  if(selectStatus.value !== 1){
+  if(selectStatus.value !== 0){
     message.error("已存在申请")
   }else{
     studentSelectSupervisorPop.value.open(id,studentId,type, projectId ,supervisorId)