From 225b3b8ffe5979f7def7d5bd472473a33df59ec1 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Thu, 29 May 2025 16:32:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=99=BB=E8=AE=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=8F=8Apdf=E4=B8=8B=E8=BD=BD=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/file/pdf/smryscb.pdf | Bin 346415 -> 346415 bytes .../templates/system/newdev/apply/add.html | 69 +++++++++++++++++- .../templates/system/newdev/apply/edit.html | 48 ++++++++++++ .../system/newdev/apply/editFile.html | 43 +++++------ 4 files changed, 136 insertions(+), 24 deletions(-) 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 c3a5fe7f3f7adc3c22e43abf410bb15c3c2a6157..c3072307adc25fdde08f2b2210ca7ee1cf24d20b 100644 GIT binary patch delta 130 zcmZ2KNp$@r(GAgztY(H5rUuOkjN20!8BYsw7+D$uMNG`63kWdEOjqDzWaTuqR4_F$ z(=#%h9xKB5pWDLRP{GJt&(PG&a_T|G#O)_U8K3h(jA`GZ!U)7nK+FupEZeuJu-dB# aSQ;A}SeltSTUZzxyBWHePiOXI)d2wHiXvA4 delta 125 zcmZ2KNp$@r(GAgztfnUBhDOZ^jN20!8BYtb8JZZHn3zrfz|AN(U4f60gAFLJXJj%x zR)q0Cm!*+~f{~e?p^^D?Moz}0?I%PTpYuUXXy2m32*gZ4%nZaV+qbB&+N%gS8af)7 V8#}qUy16)+o0}L(0RVMrA%g$_ 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;