448 lines
18 KiB
Plaintext
448 lines
18 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
||
<%@ include file="/webpage/include/taglib.jsp" %>
|
||
<html>
|
||
<head>
|
||
<title>考核方式列表</title>
|
||
<meta name="decorator" content="default"/>
|
||
<script type="text/javascript">
|
||
function doSubmit() {
|
||
var flag = false;
|
||
var formData = $("#inputForm").serialize();
|
||
$.ajax({
|
||
url: "${ctx}/assessmentCriterion/index/saveMethod",
|
||
async: false,
|
||
type: "POST",
|
||
data: formData,
|
||
success: function (result) {
|
||
if (result === "200") {
|
||
layer.msg('添加成功!', {icon: 1});
|
||
flag = true;
|
||
} else {
|
||
flag = false;
|
||
layer.msg('添加失败!', {icon: 2});
|
||
}
|
||
}
|
||
});
|
||
return flag;
|
||
}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<form id="inputForm" style="width: 90%;margin: auto auto" class="form-horizontal">
|
||
<input type="hidden" name="id" value="${bean.id}">
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<tbody>
|
||
<tr>
|
||
<td class="width-15 active"><label class="pull-right">指标名称:</label></td>
|
||
<td class="width-35">
|
||
<input type="text" value="${bean.name}" readonly disabled class="form-control required"/>
|
||
</td>
|
||
<td class="width-15 active"><label class="pull-right">考核方式:</label></td>
|
||
<td class="width-35">
|
||
<select id="assessmentMethods" name="method" onchange="controlShowOrHide()" class="form-control required" data-rel="chosen">
|
||
<option value="0">请选择</option>
|
||
<option value="1" <c:if test="${bean.method == 1}">selected</c:if>>直接考核</option>
|
||
<option value="2" <c:if test="${bean.method == 2}">selected</c:if>>系统获取</option>
|
||
<option value="3" <c:if test="${bean.method == 3}">selected</c:if>>机构提交</option>
|
||
<option value="4" <c:if test="${bean.method == 4}">selected</c:if>>问卷考核</option>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</form>
|
||
<div style="width: 90%;margin: auto auto">
|
||
<div id="questions" style="display: none">
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<thead>
|
||
<tr>
|
||
<td colspan="12" style="font-size: x-large">
|
||
问卷管理
|
||
<buttion title="新增" class="layui-btn layui-btn-sm" onclick="addQuestions()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="编辑" style="background-color: green" class="layui-btn layui-btn-sm" onclick="editQuestions()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="删除" class="layui-btn layui-btn-sm layui-btn-danger" onclick="deleteQuestions()"><i class="layui-icon"></i></buttion>
|
||
</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr style="background-color: #F5F5F6">
|
||
<th style="width: 20px"><input id="checkbox3" type="checkbox" class="i-checks"></th>
|
||
<th>问卷名称</th>
|
||
<th>访问人群</th>
|
||
<th>人群数量</th>
|
||
</tr>
|
||
<c:forEach items="${peopleBeans}" var="peopleBean">
|
||
<tr>
|
||
<td><input type="checkbox" value="${peopleBean.id}" class="i-checks"></td>
|
||
<td>${peopleBean.directoryName}</td>
|
||
<td>${peopleBean.peopleClassEn}</td>
|
||
<td>${peopleBean.peopleClassNum}</td>
|
||
</tr>
|
||
</c:forEach>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<br>
|
||
<div id="files" style="display: none">
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<thead>
|
||
<tr>
|
||
<td colspan="5" style="font-size: x-large">
|
||
文件管理
|
||
<buttion title="新增" class="layui-btn layui-btn-sm" onclick="addFiles()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="编辑" style="background-color: green" class="layui-btn layui-btn-sm" onclick="editFiles()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="删除" class="layui-btn layui-btn-sm layui-btn-danger" onclick="deleteFiles()"><i class="layui-icon"></i></buttion>
|
||
</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr style="background-color: #F5F5F6">
|
||
<th style="width: 20px"><input id="checkbox2" type="checkbox" class="i-checks"></th>
|
||
<th>文件标题</th>
|
||
<th>备注</th>
|
||
<th>创建人</th>
|
||
<th>创建时间</th>
|
||
</tr>
|
||
<c:forEach items="${fileListBeans}" var="fileListBean">
|
||
<tr>
|
||
<td><input type="checkbox" value="${fileListBean.id}" class="i-checks"></td>
|
||
<td>${fileListBean.fileTile}</td>
|
||
<td>${fileListBean.remarks}</td>
|
||
<td>${fileListBean.createBy.name}</td>
|
||
<td>${fileListBean.createDate}</td>
|
||
</tr>
|
||
</c:forEach>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<br>
|
||
<div id="params" style="display: none">
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<thead>
|
||
<tr>
|
||
<td colspan="5" style="font-size: x-large">
|
||
参数管理
|
||
<buttion title="新增" class="layui-btn layui-btn-sm" onclick="addParams()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="编辑" style="background-color: green" class="layui-btn layui-btn-sm" onclick="editParams()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="删除" class="layui-btn layui-btn-sm layui-btn-danger" onclick="deleteParams()"><i class="layui-icon"></i></buttion>
|
||
</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr style="background-color: #F5F5F6">
|
||
<th style="width: 20px"><input id="checkbox0" type="checkbox" class="i-checks"></th>
|
||
<th>参数名称</th>
|
||
<th>参数类型</th>
|
||
<th>表名称</th>
|
||
<th>列名称</th>
|
||
</tr>
|
||
<c:forEach items="${paramsBeans}" var="paramsBean">
|
||
<tr>
|
||
<td><input type="checkbox" value="${paramsBean.id}" class="i-checks"></td>
|
||
<td>${paramsBean.varName}</td>
|
||
<c:if test="${paramsBean.varType eq '1'}">
|
||
<td>问卷绑定</td>
|
||
</c:if>
|
||
<c:if test="${paramsBean.varType eq '2'}">
|
||
<td>公式左侧</td>
|
||
</c:if>
|
||
<c:if test="${paramsBean.varType eq '3'}">
|
||
<td>系统绑定</td>
|
||
</c:if>
|
||
<c:if test="${paramsBean.varType eq '4'}">
|
||
<td>直接填写</td>
|
||
</c:if>
|
||
<td>${paramsBean.basicsTablenameEn}</td>
|
||
<td>${paramsBean.basicsColumnnameEn}</td>
|
||
</tr>
|
||
</c:forEach>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<br>
|
||
<div id="formulas" style="display: none">
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<thead>
|
||
<tr>
|
||
<td colspan="7" style="font-size: x-large">
|
||
公式管理
|
||
<buttion title="新增" class="layui-btn layui-btn-sm" onclick="addFormulas()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="编辑" style="background-color: green" class="layui-btn layui-btn-sm" onclick="editFormulas()"><i class="layui-icon"></i></buttion>
|
||
<buttion title="删除" class="layui-btn layui-btn-sm layui-btn-danger" onclick="deleteFormulas()"><i class="layui-icon"></i></buttion>
|
||
</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr style="background-color: #F5F5F6">
|
||
<th style="width: 20px"><input id="checkbox1" type="checkbox" class="i-checks"></th>
|
||
<th>考核评分类别</th>
|
||
<th>公式类别</th>
|
||
<th>公式左侧</th>
|
||
<th>运算符</th>
|
||
<th>公式右侧</th>
|
||
<th>执行顺序</th>
|
||
</tr>
|
||
<c:forEach items="${formulasBeans}" var="formulasBean">
|
||
<tr>
|
||
<td><input type="checkbox" value="${formulasBean.id}" class="i-checks" /></td>
|
||
<td>
|
||
<c:if test="${formulasBean.formulaKind eq '1'}">考核方式</c:if>
|
||
<c:if test="${formulasBean.formulaKind eq '2'}">评分</c:if>
|
||
</td>
|
||
<td>
|
||
<c:if test="${formulasBean.formulaType eq '1001'}">普通公式</c:if>
|
||
<c:if test="${formulasBean.formulaType eq '1002'}">IF-THAN公式</c:if>
|
||
</td>
|
||
<td>${formulasBean.formulaLeft}</td>
|
||
<td>${formulasBean.formulaCenter}</td>
|
||
<td>${formulasBean.formulaRight}</td>
|
||
<td>${formulasBean.executionOrder}</td>
|
||
</tr>
|
||
</c:forEach>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">
|
||
var targetId = "${bean.id}";
|
||
|
||
// 添加
|
||
function addParams() {
|
||
var url = "${ctx}/assessmentCriterion/methods/params/form?targetId=" + targetId;
|
||
openMethodsDialog(url, "新增参数", 1200, 700)
|
||
}
|
||
|
||
function addFormulas() {
|
||
var url = "${ctx}/assessmentCriterion/methods/formulas/form?targetId=" + targetId;
|
||
openMethodsDialog(url, "新增公式", 1200, 700)
|
||
}
|
||
|
||
function addFiles() {
|
||
var url = "${ctx}/assessmentCriterion/methods/files/form?targetId=" + targetId;
|
||
openMethodsDialog(url, "新增文件", 1200, 700)
|
||
}
|
||
|
||
function addQuestions() {
|
||
var url = "${ctx}/assessmentCriterion/methods/question/form?targetId=" + targetId;
|
||
openMethodsDialog(url, "新增问卷", 1200, 700)
|
||
}
|
||
|
||
// 编辑
|
||
function editParams() {
|
||
$.each($('input:checkbox:checked'), function () {
|
||
var length = $('input[type=checkbox]:checked').length;
|
||
if (length === 1) {
|
||
var id = $(this).val();
|
||
var url = "${ctx}/assessmentCriterion/methods/params/form?id=" + id;
|
||
openMethodsDialog(url, "编辑参数", 900, 700);
|
||
} else {
|
||
layer.msg("请选择一个!");
|
||
}
|
||
});
|
||
}
|
||
|
||
function editFormulas() {
|
||
$.each($('input:checkbox:checked'), function () {
|
||
var length = $('input[type=checkbox]:checked').length;
|
||
if (length === 1) {
|
||
var id = $(this).val();
|
||
var url = "${ctx}/assessmentCriterion/methods/formulas/form?id=" + id;
|
||
openMethodsDialog(url, "编辑参数", 900, 700);
|
||
} else {
|
||
layer.msg("请选择一个!");
|
||
}
|
||
});
|
||
}
|
||
|
||
function editFiles() {
|
||
$.each($('input:checkbox:checked'), function () {
|
||
var length = $('input[type=checkbox]:checked').length;
|
||
if (length === 1) {
|
||
var id = $(this).val();
|
||
var url = "${ctx}/assessmentCriterion/methods/files/form?id=" + id;
|
||
openMethodsDialog(url, "编辑文件", 900, 700);
|
||
} else {
|
||
layer.msg("请选择一个!");
|
||
}
|
||
});
|
||
}
|
||
|
||
function editQuestions() {
|
||
$.each($('input:checkbox:checked'), function () {
|
||
var length = $('input[type=checkbox]:checked').length;
|
||
if (length === 1) {
|
||
var id = $(this).val();
|
||
var url = "${ctx}/assessmentCriterion/methods/question/form?id=" + id;
|
||
openMethodsDialog(url, "编辑文件", 900, 700);
|
||
} else {
|
||
layer.msg("请选择一个!");
|
||
}
|
||
});
|
||
}
|
||
|
||
//删除
|
||
function deleteParams() {
|
||
var url = "${ctx}/assessmentCriterion/methods/params/delete";
|
||
ajaxDelete(url);
|
||
}
|
||
|
||
function deleteFormulas() {
|
||
var url = "${ctx}/assessmentCriterion/methods/formulas/delete";
|
||
ajaxDelete(url);
|
||
}
|
||
|
||
function deleteFiles() {
|
||
var url = "${ctx}/assessmentCriterion/methods/files/delete";
|
||
ajaxDelete(url);
|
||
}
|
||
|
||
function deleteQuestions() {
|
||
var url = "${ctx}/assessmentCriterion/methods/question/delete";
|
||
ajaxDelete(url);
|
||
}
|
||
|
||
function ajaxDelete(url) {
|
||
$.each($('input:checkbox:checked'), function () {
|
||
var length = $('input[type=checkbox]:checked').length;
|
||
if (length === 1) {
|
||
var id = $(this).val();
|
||
top.layer.confirm(
|
||
"确认是否删除?",
|
||
{
|
||
btn: ['确认', '取消'],
|
||
yes: function (index, layero) {
|
||
$.ajax({
|
||
url: url,
|
||
async: false,
|
||
type: "POST",
|
||
data: {"id": id},
|
||
success: function (result) {
|
||
if (result === "200") {
|
||
top.layer.close(index);
|
||
layer.msg('删除成功!', {icon: 1});
|
||
location.reload()
|
||
} else {
|
||
top.layer.close(index);
|
||
layer.msg('删除失败!', {icon: 2});
|
||
location.reload()
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
} else {
|
||
layer.msg("请选择一个!");
|
||
}
|
||
});
|
||
}
|
||
|
||
//多表选中状态
|
||
function isCheckedMultiTable() {
|
||
$(".iCheck-helper").on('click', function () {
|
||
var checkid = $(this).prev().attr("id");
|
||
if (checkid === "checkbox3" || checkid === "checkbox2" || checkid === "checkbox1" || checkid === "checkbox0") {
|
||
if ($(this).prev().attr("checked")) {
|
||
$(this).prev().attr("checked", "checked");
|
||
var tb = $(this).parents("tbody").children("tr");
|
||
$(tb).each(function () {
|
||
$(this).children().children().children("input").attr("checked", "checked");
|
||
$(this).children().children(".icheckbox_square-green").addClass("checked");
|
||
})
|
||
} else {
|
||
$(this).prev().removeAttr("checked");
|
||
var tb = $(this).parents("tbody").children("tr");
|
||
$(tb).each(function () {
|
||
$(this).children().children().children("input").removeAttr("checked");
|
||
$(this).children().children(".icheckbox_square-green").removeClass("checked");
|
||
})
|
||
}
|
||
} else {
|
||
if ($(this).prev().attr("checked")) {
|
||
$(this).prev().attr("checked", "checked");
|
||
} else {
|
||
$(this).prev().removeAttr("checked");
|
||
}
|
||
}
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 获取考核方式选中的值
|
||
*/
|
||
function getSelectedVal() {
|
||
var selectedVal = $("#assessmentMethods").find('option:selected').val();
|
||
return selectedVal;
|
||
}
|
||
|
||
function controlShowOrHide() {
|
||
var selectedVal = getSelectedVal();
|
||
var params = $("#params");
|
||
var formulas = $("#formulas");
|
||
var files = $("#files");
|
||
var questions = $("#questions");
|
||
if (selectedVal === "0" || selectedVal === "1") {
|
||
params.hide();
|
||
formulas.hide();
|
||
files.hide();
|
||
questions.hide();
|
||
} else if (selectedVal === "2") {
|
||
params.show();
|
||
formulas.show();
|
||
files.hide();
|
||
questions.hide();
|
||
} else if (selectedVal === "3") {
|
||
params.show();
|
||
formulas.show();
|
||
files.show();
|
||
questions.hide();
|
||
} else if (selectedVal === "4") {
|
||
params.show();
|
||
formulas.show();
|
||
files.show();
|
||
questions.show();
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 考核方式对话框
|
||
* @param url 地址
|
||
* @param title 标题
|
||
* @param width 宽
|
||
* @param height 高
|
||
*/
|
||
function openMethodsDialog(url, title, width, height) {
|
||
top.layer.open({
|
||
type: 2,
|
||
area: [width + 'px', height + 'px'],
|
||
title: title,
|
||
maxmin: true,
|
||
content: url,
|
||
btn: ['确定', '关闭'],
|
||
yes: function (index, layero) {
|
||
var body = top.layer.getChildFrame('body', index);
|
||
// 得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||
var iframeWin = layero.find('iframe')[0];
|
||
var inputForm = body.find('#inputForm');
|
||
// 获取当前active的tab的iframe
|
||
var top_iframe = top.getActiveTab().attr("name");
|
||
// 表单提交成功后,从服务器返回的url在当前tab中展示
|
||
inputForm.attr("target", top_iframe);
|
||
if (iframeWin.contentWindow.doSubmit()) {
|
||
setTimeout(function () {
|
||
top.layer.close(index);
|
||
location.reload()
|
||
}, 1000);
|
||
}
|
||
},
|
||
cancel: function (index) {
|
||
}
|
||
});
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
isCheckedMultiTable();
|
||
controlShowOrHide();
|
||
});
|
||
</script>
|
||
</body>
|
||
</html> |