<template>
|
<div v-if="pdfUrl">
|
<el-row class="p-3 m-0" justify="space-between" align="middle">
|
<el-col :span="4"></el-col>
|
<el-col :span="16">
|
<el-row justify="center">
|
<el-text class="text-lg font-bold text-center">
|
{{ title }}
|
</el-text>
|
</el-row>
|
</el-col>
|
<el-col :span="4">
|
<el-row justify="center">
|
<el-button
|
v-if="!isVerified"
|
text style="color: var(--el-color-primary);"
|
:loading="saveLoading" @click="tempSave()"
|
class="mx-4"
|
>
|
暂存
|
</el-button>
|
</el-row>
|
</el-col>
|
</el-row>
|
|
<el-divider class="m-0" style="flex-shrink: 0;"></el-divider>
|
<el-scrollbar :height="`${mainHeight}px`" class="p-2 m-0 mt-1" >
|
<div v-if="pdfUrl" :style="{width: '100%', height: `${mainHeight - 100}px`}">
|
<PdfPreview v-if="pdfUrl" :url="pdfUrl"></PdfPreview>
|
</div>
|
<div class="p-2 my-4">
|
<el-form ref="verifyForm" :model="form">
|
<el-form-item label="*以上申报内容是否属实" prop="isVerified">
|
<el-radio-group v-model="form.isContentTrue" :disabled="isVerified">
|
<el-radio :value="1">是</el-radio>
|
<el-radio :value="0">否</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
<el-form-item label="*该考点核验是否通过" prop="isPass">
|
<el-radio-group v-model="form.isSitePass" :disabled="isVerified">
|
<el-radio :value="1">是</el-radio>
|
<el-radio :value="0">否</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
<el-row><el-text>专家评估意见</el-text></el-row>
|
<el-form-item class="mt-1">
|
<el-input
|
v-model="form.suggestion"
|
:rows="3"
|
type="textarea"
|
placeholder="请填写评估意见"
|
:disabled="isVerified"
|
/>
|
</el-form-item>
|
<el-row><el-text>*现场工作照片</el-text></el-row>
|
<el-row>
|
<UploadBtn v-model="form.image" :disabled="isVerified" :accept="['pdf', 'jpg']" :limitFileCount="10" listType="picture-card"></UploadBtn>
|
</el-row>
|
|
<Signature v-model="form.signatureUrl" :disabled="isVerified" :isRequire="true"></Signature>
|
|
<el-button
|
v-if="!isVerified"
|
@click="submitVerify"
|
type="primary" size="large"
|
class="my-7" style="width: 100%;"
|
:loading="submitLoading"
|
>提交核验结果</el-button>
|
</el-form>
|
</div>
|
</el-scrollbar>
|
</div>
|
</template>
|
<script>
|
import PdfPreview from '@/views/main/components/PdfPreview.vue'
|
import { useWindowSize } from '@/utils/hook.js'
|
import Signature from '@/views/main/components/Signature.vue';
|
import { useSessionStore } from '@/stores/session.js'
|
import { storeToRefs } from 'pinia';
|
|
export default {
|
components: {
|
PdfPreview,
|
Signature
|
},
|
setup() {
|
const { height } = useWindowSize()
|
const { userInfo } = storeToRefs(useSessionStore())
|
return { pageHeight: height, userInfo }
|
},
|
data() {
|
return {
|
title: '',
|
pdfUrl: '',
|
form: {
|
id: '',
|
isContentTrue: 0,
|
isSitePass: 0,
|
suggestion: '',
|
image: [],
|
signatureUrl: ''
|
},
|
isVerified: false,
|
saveLoading: false,
|
submitLoading: false
|
}
|
},
|
computed: {
|
mainHeight() {
|
return this.pageHeight - 80
|
},
|
appId() {
|
return this.$route.query.appId
|
}
|
},
|
async created() {
|
this.getVerifyDetail()
|
},
|
mounted() {
|
document.title = '考点核验'
|
},
|
methods: {
|
getVerifyDetail() {
|
const params = { applicationId: this.appId }
|
this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
|
if (res.data.code == 0) {
|
const resData = res.data.data || {}
|
this.pdfUrl = this.$qxueyou.qxyRes + resData.examSiteVerifyFile
|
this.title = resData.organizationName + '-' + resData.examSite.siteName + '考点核验'
|
if (resData.id) {
|
this.form.isContentTrue = resData.isContentTrue
|
this.form.isSitePass = resData.isSitePass
|
this.form.suggestion = resData.evaluationOpinion
|
resData.sitePhotos?.forEach(ele => {
|
this.form.image.push({ name: '', url: ele })
|
})
|
this.form.signatureUrl = resData.signatureUrl
|
this.isVerified = resData.isVerified
|
}
|
} else {
|
this.$message.error('获取核验信息失败')
|
}
|
})
|
},
|
tempSave() {
|
const data = {
|
applicationId: this.appId,
|
id: this.form.id,
|
userId: this.userInfo.id,
|
name: this.userInfo.name,
|
mobile: this.userInfo.mobile,
|
idNumber: this.userInfo.idCard,
|
isContentTrue: this.form.isContentTrue,
|
isSitePass: this.form.isSitePass,
|
evaluationOpinion: this.form.suggestion,
|
sitePhotos: this.form.image.map(ele => ele.url),
|
signatureUrl: this.form.signatureUrl,
|
}
|
this.saveLoading = true
|
this.$axios.put(`/exam/verify-record/save`, data).then(res => {
|
if (res.data.code == 0) {
|
this.$message.success('保存成功')
|
this.getVerifyDetail()
|
} else {
|
this.$message.error(res.data.msg)
|
}
|
}).finally(() => {
|
this.saveLoading = false
|
})
|
},
|
submitVerify() {
|
if (this.form.image.length==0) {
|
this.$message.error('请上传现场工作照片')
|
return
|
}
|
if (!this.form.signatureUrl) {
|
this.$message.error('请填写签名')
|
return
|
}
|
this.$messageBox.confirm('提交之后不可再编辑核验,确认提交吗', '提示',
|
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'tip' }).then(res => {
|
if (res == 'confirm') {
|
this.submitLoading = true
|
const data = {
|
applicationId: this.appId,
|
isContentTrue: this.form.isContentTrue,
|
isSitePass: this.form.isSitePass,
|
evaluationOpinion: this.form.suggestion,
|
sitePhotos: this.form.image.map(ele => ele.url),
|
signatureUrl: this.form.signatureUrl,
|
}
|
this.$axios.post('/exam/verify-record/verify', data).then(res => {
|
if (res.data.code == 0) {
|
this.$message.success('提交核验成功')
|
this.isVerified = true
|
} else {
|
this.$message.error(res.data.msg || '提交核验失败')
|
}
|
}).finally(() => {
|
this.submitLoading = false
|
})
|
}
|
})
|
},
|
onPagesLoaded(msg) {
|
console.log(msg)
|
},
|
onError(msg) {
|
console.log(msg)
|
},
|
onPageChange() {}
|
}
|
}
|
</script>
|