|
|
|
@ -62,7 +62,7 @@
|
|
|
|
|
<main class="flex-grow container mx-auto px-4 py-8" style="max-width: 100%;">
|
|
|
|
|
<div class="max-w-10xl mx-auto" style="width: 100%;">
|
|
|
|
|
<div class="bg-white rounded-xl shadow-soft p-6 mb-8 scale-hover">
|
|
|
|
|
<form class="form-horizontal space-y-6" id="form-apply-edit" th:object="${applyInfoList}">
|
|
|
|
|
<form class="form-horizontal space-y-6" id="form-apply-edit" th:object="${applyInfoList}" @submit.prevent="submitForm">
|
|
|
|
|
<input name="applyId" type="hidden" th:field="*{applyId}"/>
|
|
|
|
|
<h4 class="form-header h4">基本信息</h4>
|
|
|
|
|
<!-- 文本字段 -->
|
|
|
|
@ -276,9 +276,21 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 按钮 -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<a :href="pdfUrl" download="涉密人员调离岗位审批表.pdf" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">
|
|
|
|
|
<i class="fa-solid fa-download mr-2"></i> 下载模版
|
|
|
|
|
<!-- <div class="row">-->
|
|
|
|
|
<!-- <a :href="pdfUrl" download="涉密人员调离岗位审批表.pdf" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">-->
|
|
|
|
|
<!-- <i class="fa-solid fa-download mr-2"></i> 生成-->
|
|
|
|
|
<!-- </a>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- 按钮 -->
|
|
|
|
|
<div class="row" style="display: ruby;">
|
|
|
|
|
<button type="submit" class="group relative w-full max-w-xs flex justify-center py-3 px-6 border border-transparent text-base font-medium rounded-lg text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-all duration-300">
|
|
|
|
|
<span class="absolute left-0 inset-y-0 flex items-center pl-3" style="margin-right: 5px;">
|
|
|
|
|
<i class="fa-solid fa-file-pdf text-white transform group-hover:translate-x-0.5 transition-transform duration-200"></i>
|
|
|
|
|
</span>
|
|
|
|
|
生成调离岗位审批表
|
|
|
|
|
</button>
|
|
|
|
|
<a v-if="showResult" :href="pdfUrl" download="涉密人员调离岗位审批表.pdf" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">
|
|
|
|
|
<i class="fa-solid fa-download mr-2"></i> 下载PDF
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
@ -403,7 +415,9 @@
|
|
|
|
|
applyId: '',
|
|
|
|
|
},
|
|
|
|
|
selectedFile: null,
|
|
|
|
|
pdfUrl: '/file/pdfFiles/涉密人员调离岗位审批表.pdf',
|
|
|
|
|
isLoading: false,
|
|
|
|
|
showResult: false,
|
|
|
|
|
pdfUrl: '',
|
|
|
|
|
// 新增文件上传相关数据
|
|
|
|
|
selectedFiles: null,
|
|
|
|
|
currentFileName: '',
|
|
|
|
@ -421,6 +435,52 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
submitForm() {
|
|
|
|
|
// 简单验证
|
|
|
|
|
if (!this.formData.name || !this.formData.sex || !this.formData.nationa || !this.formData.nationality || !this.formData.maritalStatus || !this.formData.political || !this.formData.phone || !this.formData.cerno || !this.formData.address || !this.formData.registeredAuthority || !this.formData.permanentAddress || !this.formData.residentBureau || !this.formData.positionCapacity || !this.formData.smPost || !this.formData.smGrade) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请填写所有必填字段',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 检查是否上传了照片
|
|
|
|
|
if (!this.selectedFile) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请上传一寸照片',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 准备表单数据
|
|
|
|
|
let formData = new FormData();
|
|
|
|
|
if (this.formData.name) formData.append("name", this.formData.name);
|
|
|
|
|
if (this.formData.sex) formData.append("sex", this.formData.sex);
|
|
|
|
|
if (this.formData.phone) formData.append("phone", this.formData.phone);
|
|
|
|
|
if (this.formData.smPost) formData.append("smPost", this.formData.smPost);
|
|
|
|
|
if (this.formData.smGrade) formData.append("smGrade", this.formData.smGrade);
|
|
|
|
|
formData.append('photo', this.selectedFile);
|
|
|
|
|
// 显示加载状态
|
|
|
|
|
this.isLoading = true;
|
|
|
|
|
// 发送请求
|
|
|
|
|
axios.post('/api/ChangePdf/ChangeFill', formData, {
|
|
|
|
|
responseType: 'blob'
|
|
|
|
|
})
|
|
|
|
|
.then(response => {
|
|
|
|
|
// 创建下载URL
|
|
|
|
|
let blob = new Blob([response.data], { type: 'application/pdf' });
|
|
|
|
|
this.pdfUrl = window.URL.createObjectURL(blob);
|
|
|
|
|
this.$message.success('生成pdf成功,请点击下载!');
|
|
|
|
|
// 隐藏加载状态,显示结果
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
this.showResult = true;
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('Error:', error);
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
this.$message.error('生成PDF时出错,请重试');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleFileUpload(event) {
|
|
|
|
|
let file = event.target.files[0];
|
|
|
|
|
if (file) {
|
|
|
|
|