|
@@ -129,7 +129,7 @@
|
|
|
></canvas>
|
|
|
<div style="display: flex; justify-content: flex-start; margin-top: 10px;">
|
|
|
<el-button type="primary" @click="handleSupervisorSignatureSave" size="small">保存</el-button>
|
|
|
- <el-button @click="ClearStudentSignature" size="small">清空</el-button>
|
|
|
+ <el-button @click="ClearSupervisorSignature" size="small">清空</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <p v-if="userInfo.userType==='4'">日期:{{formData.supervisorSignDate}}</p> -->
|
|
@@ -659,24 +659,24 @@ const submitForm = async () => {
|
|
|
const data = formData.value as unknown as studentSelectSupervisorRecordVO;
|
|
|
console.log(data)
|
|
|
if (formType.value === 'create') {
|
|
|
- // const isStudentSignatureSaved = formData.value.studentSignature.startsWith('data:image/png;base64,');
|
|
|
- // if (!isStudentSignatureSaved && (userInfo.value.userType === '1')) {
|
|
|
- // message.error('请先保存签名');
|
|
|
- // formLoading.value = false;
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ const isStudentSignatureSaved = formData.value.studentSignature.startsWith('data:image/png;base64,');
|
|
|
+ if (!isStudentSignatureSaved && (userInfo.value.userType === '1')) {
|
|
|
+ message.error('请先保存签名');
|
|
|
+ formLoading.value = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
await studentSelectSupervisorRecordApi.createStudentSelectSupervisorRecord(data);
|
|
|
message.success(t('common.createSuccess'));
|
|
|
} else if (formType.value === 'update') {
|
|
|
await studentSelectSupervisorRecordApi.updateStudentSelectSupervisorRecord(data);
|
|
|
message.success(t('common.updateSuccess'));
|
|
|
} else if (formType.value === 'agree') {
|
|
|
- // const isSupervisorSignatureSaved = formData.value.supervisorSignature.startsWith('data:image/png;base64,');
|
|
|
- // if (!isSupervisorSignatureSaved && (userInfo.value.userType === '3'|| userInfo.value.userType === '5')) {
|
|
|
- // message.error('请先保存签名');
|
|
|
- // formLoading.value = false;
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ const isSupervisorSignatureSaved = typeof formData.value.supervisorSignature === 'string' && formData.value.supervisorSignature.startsWith('data:image/png;base64,');
|
|
|
+ if (!isSupervisorSignatureSaved && (userInfo.value.userType === '3'|| userInfo.value.userType === '5')) {
|
|
|
+ message.error('请先保存签名');
|
|
|
+ formLoading.value = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
await studentSelectSupervisorRecordApi.agreeStudentSelectSupervisorRecord(data);
|
|
|
message.success("已经同意申请");
|
|
|
}else if (formType.value === 'updateone') {
|