增加上传医生签名图片预览功能

This commit is contained in:
Euni4U 2024-12-11 11:22:24 +08:00
parent fb27bc2fcb
commit 564c5dfe34

View File

@ -30,11 +30,11 @@
<el-form-item label="所属科室" prop="departmentName">
<el-select v-model="formData.departmentName" placeholder="请选择科室">
<el-option
v-for="item in fordepartementData"
:key="item.id"
:label="item.departmentName"
:value="item.departmentName"
/>
v-for="item in fordepartementData"
:key="item.id"
:label="item.departmentName"
:value="item.departmentName"
/>
</el-select>
</el-form-item>
<el-form-item label="医生联系电话" prop="doctorTel">
@ -45,9 +45,9 @@
</el-form-item>
<el-form-item label="医生电子签名" prop="eSignatureUrl">
<el-image
v-model="formData.eSignatureUrl"
v-model="formData.esignatureUrl"
style="width: 160px; height: 120px"
:src="formData.eSignatureUrl"
:src="formData.esignatureUrl"
fit="fill"
/>
@ -75,17 +75,23 @@
</el-select>
</el-form-item>
<el-form-item label="机构名称" prop="orgId">
<el-select
v-model="formData.orgId"
placeholder="请选择机构"
clearable
>
<el-option v-for="item in fororglistData" :key="item.orgID" :label="item.orgName" :value="item.orgID" />
<el-select v-model="formData.orgId" placeholder="请选择机构" clearable>
<el-option
v-for="item in fororglistData"
:key="item.orgID"
:label="item.orgName"
:value="item.orgID"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" :disabled="formLoading" style="background-color: rgb(56, 119, 246); font-size: 14; color: rgb(255, 255, 255)"> </el-button>
<el-button
@click="submitForm"
:disabled="formLoading"
style="background-color: rgb(56, 119, 246); font-size: 14; color: rgb(255, 255, 255)"
> </el-button
>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
@ -120,7 +126,7 @@ const formData = ref({
departmentName: undefined,
doctorTel: undefined,
remark: undefined,
eSignatureUrl: undefined,
esignatureUrl: undefined,
doctorLevel: undefined,
orgId: undefined,
departmentCode: undefined
@ -141,11 +147,13 @@ const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
fororglistData.value=await OrgApi.getOrglist()
//
fordepartementData.value = await DepartmentApi.getDepartmentList()
formData.value.esignatureUrl = formData.value.esignatureUrl
fororglistData.value = await OrgApi.getOrglist()
//
fordepartementData.value = await DepartmentApi.getDepartmentList()
//
if (id) {
formLoading.value = true
@ -202,7 +210,7 @@ const resetForm = () => {
departmentName: undefined,
doctorTel: undefined,
remark: undefined,
eSignatureUrl: undefined,
esignatureUrl: undefined,
doctorLevel: undefined,
orgId: undefined,
departmentCode: undefined
@ -232,8 +240,8 @@ const handleChange = (file, fileList) => {
reader.readAsDataURL(file.raw)
reader.onload = (event) => {
imageBase64.value = event.target.result
// Base64
//console.log(base64Data)
// base64formData.eSignatureUrl
formData.value.esignatureUrl = event.target.result
}
imagefilename.value = file.name
}