From 019aeeaa603d304efe710fd7ef8d46c476396f51 Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Mon, 9 Oct 2023 09:59:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/yingji/echarts/finishRate.vue | 4 +-- src/views/yingji/focusEnter.vue | 48 ++++++++++++++++++++++--- src/views/yingji/home.vue | 39 +++++++++++--------- 3 files changed, 67 insertions(+), 24 deletions(-) diff --git a/src/views/yingji/echarts/finishRate.vue b/src/views/yingji/echarts/finishRate.vue index 7ffbfac..0606cdf 100644 --- a/src/views/yingji/echarts/finishRate.vue +++ b/src/views/yingji/echarts/finishRate.vue @@ -87,11 +87,11 @@ export default { trigger: "item", }, legend: { - width: "45%", + width: "40%", top: "25%", right: "10%", orient: "horizontal", - itemGap: 25, + itemGap: 27, itemWidth: 10, itemHeight: 10, icon: "circle", diff --git a/src/views/yingji/focusEnter.vue b/src/views/yingji/focusEnter.vue index e0e53d9..e79a6a3 100644 --- a/src/views/yingji/focusEnter.vue +++ b/src/views/yingji/focusEnter.vue @@ -165,6 +165,7 @@ @@ -185,9 +186,9 @@ @@ -314,6 +315,45 @@ export default { components: { myPagination, executive }, name: "Article", data() { + //验证统一社会信用代码 + var checkSocialCreditCode = (rule, code, callback) => { + // 空值直接返回false + if (!code) { + return callback(new Error("请输入统一社会信用代码")); + } + + //18位及正则校验 + const reg = /^\w\w\d{6}\w{9}\w$/; + if (code.length !== 18 || !reg.test(code)) { + return callback(new Error("请输入正确的统一社会信用代码")); + } + + const codeOrigin = "0123456789ABCDEFGHJKLMNPQRTUWXY"; // 统一社会信用代码可用字符 不含I、O、S、V、Z + const weightedfactors = [ + 1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28, + ]; // 统一社会信用代码相对应顺序的加权因子 + + let ci; // 统一社会信用代码相应顺序的值 + let wi; // 统一社会信用代码相应顺序的加权因子 + let total = 0; // 计算结果 + + // 数值与加权因子相乘之和 + for (let i = 0; i < code.length - 1; i++) { + ci = codeOrigin.indexOf(code[i]); + wi = weightedfactors[i]; + total += ci * wi; + } + + // 最后一位校验 + let logicCheckCode = 31 - (total % 31); + if (logicCheckCode === 31) logicCheckCode = 0; + logicCheckCode = codeOrigin[logicCheckCode]; + if (logicCheckCode !== code.slice(17)) { + return callback(new Error("请输入正确的统一社会信用代码")); + } else { + callback(); + } + }; return { tableData: [], options: [], @@ -361,9 +401,7 @@ export default { enterpriseName: [ { required: true, message: "请输入企业名称", trigger: "blur" }, ], - entCode: [ - { required: true, message: "请输入企业信用代码", trigger: "blur" }, - ], + entCode: [{ validator: checkSocialCreditCode, trigger: "blur" }], year: [{ required: true, message: "请选择年份", trigger: "blur" }], }, //总数 diff --git a/src/views/yingji/home.vue b/src/views/yingji/home.vue index 986564b..215a12d 100644 --- a/src/views/yingji/home.vue +++ b/src/views/yingji/home.vue @@ -35,20 +35,23 @@ -
-
- -
-
-
-
- +
+
+
+ +
-
-
- +
+
+ +
+
+
+ +
+
{ this.tableData = res.rows; - this.newTable = res.rows + this.newTable = res.rows; res.rows.forEach((value1, index1) => { if (value1.institutionName == "苏州市") { let arr1 = this.tableData.slice(index1, index1 + 1); @@ -316,7 +319,9 @@ export default { margin-top: 10px; } //=== - +.boxs { + height: calc(100% - 48px); +} .boxAllStyle { background: #ffffff; box-shadow: 0px 1px 24px 0px #e2e2e2; @@ -409,7 +414,7 @@ export default { } .bodyBox { width: 100%; - height: 250px; + height: 45%; margin-bottom: 15px; #execution { @@ -418,7 +423,7 @@ export default { } } .bottomBox { - height: calc(100% - 250px - 48px - 15px); + height: calc(100% - 45% - 15px); display: flex; justify-content: space-between; & > .boxAllStyle {