From a84f0734e41e2cd7a44a3a86a6b65235d891c6f0 Mon Sep 17 00:00:00 2001 From: kgdxpr Date: Mon, 12 Dec 2022 17:23:58 +0800 Subject: [PATCH] update --- WebRoot/html/tp/advanced.html | 45 ++++++++++++----- WebRoot/html/tp/component/layui/css/layui.css | 2 +- WebRoot/html/tp/middle.html | 48 ++++++++++++++----- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/WebRoot/html/tp/advanced.html b/WebRoot/html/tp/advanced.html index 15c2827..345b98b 100644 --- a/WebRoot/html/tp/advanced.html +++ b/WebRoot/html/tp/advanced.html @@ -19,19 +19,26 @@
-
备注:从如下人员中推荐2人。投票人身份:评委会
+
备注:从如下人员中推荐2人。
-
+
@@ -60,13 +67,14 @@ let laytpl = layui.laytpl; + //获取参评人员列表 $.ajax({ type: "GET", dataType: "json", url: "/FengHuang/TouPiao/getHouXuanRenList?type_id=1", - success: function (data) { + success: function (data) { var checkboxPersonTpl = checkboxPersonScript.innerHTML, - checkboxPersonView = document.getElementById('checkboxPersonView'); + checkboxPersonView = document.getElementById('checkboxPersonView'); laytpl(checkboxPersonTpl).render(data, function (html) { checkboxPersonView.innerHTML = html; }); @@ -74,9 +82,20 @@ } }); - - - + //获取投票人身份 1:评委小组 2:群众 + $.ajax({ + type: "GET", + dataType: "json", + url: "/FengHuang/TouPiao/getTouPiaoRenInfo", + success: function (data) { + var identityTpl = identityScript.innerHTML, + identityView = document.getElementById('identityView'); + laytpl(identityTpl).render(data, function (html) { + identityView.innerHTML = html; + }); + form.render(); + } + }); form.on('submit(submit)', function (data) { @@ -84,16 +103,16 @@ $("input:checkbox[name='selectPerson']:checked").each(function (i) { arr[i] = $(this).val(); }); - if(arr.length!=2){ - layer.msg('必须选中2人!', {icon: 5,time: 2000}); + if (arr.length != 2) { + layer.msg('只允许选中2人!', { icon: 5, time: 2000 }); return; } console.log("22222"); - + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 }); - + diff --git a/WebRoot/html/tp/component/layui/css/layui.css b/WebRoot/html/tp/component/layui/css/layui.css index 659f7cb..7dd786a 100644 --- a/WebRoot/html/tp/component/layui/css/layui.css +++ b/WebRoot/html/tp/component/layui/css/layui.css @@ -2549,7 +2549,7 @@ a cite { .layui-form-checkbox span { padding: 0 10px; height: 100%; - font-size: 14px; + font-size: 20px; border-radius: 2px 0 0 2px; background-color: #d2d2d2; color: #fff; diff --git a/WebRoot/html/tp/middle.html b/WebRoot/html/tp/middle.html index b681ee2..a7fabc0 100644 --- a/WebRoot/html/tp/middle.html +++ b/WebRoot/html/tp/middle.html @@ -19,16 +19,26 @@
-
备注:从如下人员中推荐2人。
+
备注:从如下人员中推荐2人。
+
-
+
@@ -56,14 +66,14 @@ let $ = layui.jquery; let laytpl = layui.laytpl; - + //获取参评人员列表 $.ajax({ type: "GET", dataType: "json", url: "/FengHuang/TouPiao/getHouXuanRenList?type_id=2", - success: function (data) { + success: function (data) { var checkboxPersonTpl = checkboxPersonScript.innerHTML, - checkboxPersonView = document.getElementById('checkboxPersonView'); + checkboxPersonView = document.getElementById('checkboxPersonView'); laytpl(checkboxPersonTpl).render(data, function (html) { checkboxPersonView.innerHTML = html; }); @@ -71,7 +81,23 @@ } }); - + + //获取投票人身份 1:评委小组 2:群众 + $.ajax({ + type: "GET", + dataType: "json", + url: "/FengHuang/TouPiao/getTouPiaoRenInfo", + success: function (data) { + var identityTpl = identityScript.innerHTML, + identityView = document.getElementById('identityView'); + laytpl(identityTpl).render(data, function (html) { + identityView.innerHTML = html; + }); + form.render(); + } + }); + + @@ -81,16 +107,16 @@ $("input:checkbox[name='selectPerson']:checked").each(function (i) { arr[i] = $(this).val(); }); - if(arr.length!=2){ - layer.msg('必须选中2人!', {icon: 5,time: 2000}); + if (arr.length != 2) { + layer.msg('只允许选中2人!', { icon: 5, time: 2000 }); return; } console.log("22222"); - + return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 }); - +