cyx-ament-pc/cyx-admin/src/main/resources/templates/base/affairs/add.html

247 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增党务')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-affairs-add">
<input name="method" type="hidden" id="method" class="form-control" />
<div class="form-group">
<label class="col-sm-3 control-label">类型:</label>
<div class="col-sm-8">
<select required name="type" id="type-selector" class="form-control m-b">
<option value="">请选择</option>
<option value="党务及意识形态">党务及意识形态</option>
<option value="党风廉政建设">党风廉政建设</option>
<option value="日常考核指标">日常考核指标</option>
<option value="年度考核指标">年度考核指标</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" id="target">目标项:</label>
<div class="col-sm-8">
<textarea required name="target" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" id="shotName">简写:</label>
<div class="col-sm-8">
<input required name="shotName" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" id="demand">目标要求:</label>
<div class="col-sm-8">
<textarea name="demand" class="form-control"></textarea>
</div>
</div>
<div class="form-group dy" style="display: none">
<label class="col-sm-3 control-label" >标准要求:</label>
<div class="col-sm-8">
<textarea name="method1" id="method1" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" id="detailed">工作任务:</label>
<div class="col-sm-8">
<textarea required name="detailed" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" id="score">达标分:</label>
<div class="col-sm-8">
<input required name="score" class="form-control" />
</div>
</div>
<div class="form-group dy" style="display: none">
<label class="col-sm-3 control-label" id="unit">考核类别:</label>
<div class="col-sm-8">
<input required name="unit" class="form-control" />
</div>
</div>
<div class="form-group" id="dw" style="display: none">
<label class="col-sm-3 control-label" >考核方式:</label>
<div class="col-sm-8">
<input name="method2" id="method2" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">负责人:</label>
<div class="col-sm-8">
<select required name="head" id="head" class="form-control m-b">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核人:</label>
<div class="col-sm-8">
<select required name="reviewed" id="reviewed" class="form-control m-b">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">完成截止时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input required name="finishDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group dy" style="display: none">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<select name="deptId" id="deptId" class="form-control m-b">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">支部ID</label>
<div class="col-sm-8">
<select name="branchId" id="branchId" class="form-control m-b">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "base/affairs"
$("#form-affairs-add").validate({
onkeyup: false,
focusCleanup: true
});
$(document).ready(function () {
$.ajax({
type: "post",
url: ctx + "base/personnel/personnelList",
data: {
},
success: function(data) {
var opt = '<option value="">请选择</option>';
data.data.forEach(d=>{
opt += '<option value="'+d.id+'">'+d.name+'</option>';
})
$("#head")[0].innerHTML=opt;
$("#reviewed")[0].innerHTML=opt;
}
});
$.ajax({
type: "post",
url: ctx + "base/personnel/deptList",
data: {
},
success: function(data) {
var opt = '<option value="">请选择</option>';
data.data.forEach(d=>{
opt += '<option value="'+d.deptId+'">'+d.deptName+'</option>';
})
$("#deptId")[0].innerHTML=opt;
}
});
$.ajax({
type: "post",
url: ctx + "base/personnel/branchList",
data: {
},
success: function(data) {
var opt = '<option value="">请选择</option>';
data.data.forEach(d=>{
opt += '<option value="'+d.branchId+'">'+d.branchName+'</option>';
})
$("#branchId")[0].innerHTML=opt;
}
});
})
$("#type-selector").on("change", function() {
var type = $(this).val();
var target = $("#target");
var demand = $("#demand");
var detailed = $("#detailed");
var score = $("#score");
switch (type) {
case "党务及意识形态":
$("#dw").show()
$(".dy").hide()
target[0].innerHTML = '目标项:'
demand[0].innerHTML = '目标要求:'
detailed[0].innerHTML = '工作任务:'
score[0].innerHTML = '达标分:'
break;
case "党风廉政建设":
$("#dw").show()
$(".dy").hide()
target[0].innerHTML = '责任类别:'
demand[0].innerHTML = '目标要求:'
detailed[0].innerHTML = '工作任务:'
score[0].innerHTML = '达标分:'
break;
case "日常考核指标":
$("#dw").hide()
$(".dy").show()
target[0].innerHTML = '考核内容:'
demand[0].innerHTML = '考核目标:'
detailed[0].innerHTML = '工作任务:'
score[0].innerHTML = '分值:'
break;
case "年度考核指标":
$("#dw").hide()
$(".dy").show()
target[0].innerHTML = '考核内容:'
demand[0].innerHTML = '考核目标:'
detailed[0].innerHTML = '评分办法:'
score[0].innerHTML = '分值:'
break;
}
});
function submitHandler() {
var type = $("#type-selector").val()
var method = $("#method");
var method1 = $("#method1");
var method2 = $("#method2");
switch (type) {
case "党务及意识形态":
method.val(method2.val())
break;
case "党风廉政建设":
method.val(method2.val())
break;
case "日常考核指标":
method.val(method1.val())
break;
case "年度考核指标":
method.val(method1.val())
break;
}
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-affairs-add').serialize());
}
}
$("input[name='finishDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>