|
|
|
@ -19,19 +19,26 @@
|
|
|
|
|
|
|
|
|
|
<div class="layui-card layui-form" lay-filter="component-form-element"
|
|
|
|
|
style="text-align:center;padding-top: 40px;">
|
|
|
|
|
<div class="layui-card-header" ><span style="color: red;">备注:从如下人员中推荐2人。</span><span id="identityView">投票人身份:评委会</span></div>
|
|
|
|
|
<div class="layui-card-header"><span style="color: red;">备注:从如下人员中推荐2人。</span><span
|
|
|
|
|
id="identityView" style="color: blue;"></span></div>
|
|
|
|
|
<script id="identityScript" type="text/html">
|
|
|
|
|
投票人身份:评委会
|
|
|
|
|
{{# layui.each(d.data, function(index, item){ }}
|
|
|
|
|
{{# if(item.toupiaoren_type_id == 1){ }}
|
|
|
|
|
投票人身份:评委会
|
|
|
|
|
{{# } else { }}
|
|
|
|
|
投票人身份:群众
|
|
|
|
|
{{# } }}
|
|
|
|
|
{{# }); }}
|
|
|
|
|
</script>
|
|
|
|
|
<div class="layui-card-body layui-row layui-col-space10">
|
|
|
|
|
<div class="layui-col-md12" id="checkboxPersonView">
|
|
|
|
|
<div class="layui-col-md12" id="checkboxPersonView" style="height: 60px;line-height:55px">
|
|
|
|
|
<!-- <input type="checkbox" name="selectPerson" value="1" title="写作" lay-skin="primary">
|
|
|
|
|
<input type="checkbox" name="selectPerson" value="2" title="发呆" lay-skin="primary">
|
|
|
|
|
<input type="checkbox" name="selectPerson" value="3" title="禁用" lay-skin="primary"> -->
|
|
|
|
|
</div>
|
|
|
|
|
<script id="checkboxPersonScript" type="text/html">
|
|
|
|
|
{{# layui.each(d.data, function(index, item){ }}
|
|
|
|
|
<input type="checkbox" name="selectPerson" value="{{ item.houxuanren_type_id }}" title="{{ item.houxuanren_name }}" lay-skin="primary" style="width:50px;height:50px;">
|
|
|
|
|
<input type="checkbox" name="selectPerson" value="{{ item.houxuanren_type_id }}" title="{{ item.houxuanren_name }}" lay-skin="primary">
|
|
|
|
|
{{# }); }}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
@ -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; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|