diff --git a/ruoyi-admin/src/main/resources/static/file/pdf/smryscb.pdf b/ruoyi-admin/src/main/resources/static/file/pdf/smryscb.pdf index c3a5fe7f..c3072307 100644 Binary files a/ruoyi-admin/src/main/resources/static/file/pdf/smryscb.pdf and b/ruoyi-admin/src/main/resources/static/file/pdf/smryscb.pdf differ diff --git a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/add.html b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/add.html index 38abcab8..435b7e48 100644 --- a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/add.html @@ -439,6 +439,25 @@ }) return; } + + // 验证联系方式(仅检查位数) + if (this.formData.phone.length !== 11) { + this.$message({ + message: '联系方式应为11位数字', + type: 'warning' + }) + return; + } + + // 验证身份证号 + if (!this.validateCerno(this.formData.cerno)) { + this.$message({ + message: '请输入有效的身份证号码', + type: 'warning' + }) + return; + } + // 准备表单数据 let formData = new FormData(); if (this.formData.name) formData.append("name", this.formData.name); @@ -497,6 +516,25 @@ alert('请上传一寸照片'); return; } + + // 验证联系方式(仅检查位数) + if (this.formData.phone.length !== 11) { + this.$message({ + message: '联系方式应为11位数字', + type: 'warning' + }) + return; + } + + // 验证身份证号 + if (!this.validateCerno(this.formData.cerno)) { + this.$message({ + message: '请输入有效的身份证号码', + type: 'warning' + }) + return; + } + this.$confirm('确认保存吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -514,6 +552,35 @@ }); }); }, + // 身份证号验证函数 + validateCerno(cerno) { + // 身份证号码正则表达式 + const pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + + // 基本格式验证 + if (!pattern.test(cerno)) { + return false; + } + + // 18位身份证号码的验证(包括校验位计算) + if (cerno.length === 18) { + const idCardArray = cerno.split(''); + const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + const parity = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; + let sum = 0; + + for (let i = 0; i < 17; i++) { + sum += parseInt(idCardArray[i]) * factor[i]; + } + + const lastChar = idCardArray[17].toUpperCase(); + if (lastChar !== parity[sum % 11]) { + return false; + } + } + + return true; + }, // 新增获取下拉框数据的方法 fetchPostOptions() { this.isLoadingPosts = true; @@ -553,4 +620,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/edit.html b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/edit.html index 570fe9ce..6c4cf848 100644 --- a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/edit.html @@ -497,6 +497,25 @@ }) return; } + + // 验证联系方式(仅检查位数) + if (this.formData.phone.length !== 11) { + this.$message({ + message: '联系方式应为11位数字', + type: 'warning' + }) + return; + } + + // 验证身份证号 + if (!this.validateCerno(this.formData.cerno)) { + this.$message({ + message: '请输入有效的身份证号码', + type: 'warning' + }) + return; + } + this.$confirm('确认保存吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -514,6 +533,35 @@ }); }); }, + // 身份证号验证函数 + validateCerno(cerno) { + // 身份证号码正则表达式 + const pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + + // 基本格式验证 + if (!pattern.test(cerno)) { + return false; + } + + // 18位身份证号码的验证(包括校验位计算) + if (cerno.length === 18) { + const idCardArray = cerno.split(''); + const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + const parity = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; + let sum = 0; + + for (let i = 0; i < 17; i++) { + sum += parseInt(idCardArray[i]) * factor[i]; + } + + const lastChar = idCardArray[17].toUpperCase(); + if (lastChar !== parity[sum % 11]) { + return false; + } + } + + return true; + }, // 新增获取下拉框数据的方法 fetchPostOptions() { this.isLoadingPosts = true; diff --git a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/editFile.html b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/editFile.html index 339999c2..5fa8d405 100644 --- a/ruoyi-admin/src/main/resources/templates/system/newdev/apply/editFile.html +++ b/ruoyi-admin/src/main/resources/templates/system/newdev/apply/editFile.html @@ -276,13 +276,30 @@ -
+
+ + 下载PDF + + + + + + + + + + + + + + +

材料上传

@@ -348,26 +365,6 @@
- -
-
-
- -
-
-

PDF生成成功

-

您的PDF表单已成功填写,可以点击下方按钮下载。

-
- - 下载PDF - - -
-
-
-
@@ -550,7 +547,7 @@ // 创建下载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;