275 lines
12 KiB
HTML
275 lines
12 KiB
HTML
<!doctype html>
|
|
<html xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<base th:href="${#request.getContextPath() + '/'}">
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
|
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
|
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
|
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
|
<link rel="stylesheet" href="assets/js/vendor/zTree3/css/metroStyle/metroStyle.css"/>
|
|
<style>
|
|
.layui-form-pane .layui-input-block {
|
|
margin-left: 160px;
|
|
left: -1px;
|
|
}
|
|
.layui-form-pane .layui-form-label {
|
|
width: 160px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="layui-fluid layui-anim layui-anim-fadein">
|
|
<div class="layui-card">
|
|
<div class="layui-card-header">
|
|
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
|
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
|
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
|
</span>
|
|
</div>
|
|
<div class="layui-card-body" style="padding: 15px;">
|
|
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
|
<input type="hidden" id="populationInfoId" name="charge" class="layui-input" value="" maxlength="50">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">涉邪代码</label>
|
|
<div class="layui-input-block layui-form" id="typeSelectTemplateBox" lay-filter="typeSelectTemplateBox"></div>
|
|
<script id="typeSelectTemplate" type="text/html">
|
|
<select id="type" name="type">
|
|
<option value="">请选择涉邪代码</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryName}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">涉邪时间</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="time" readonly style="cursor: pointer;" name="time" class="layui-input" value="" placeholder="请输入涉邪时间" maxlength="20">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">联系方式</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="phone" name="phone" class="layui-input" value="" placeholder="请输入联系方式" maxlength="50">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">帮扶情况</label>
|
|
<div class="layui-input-block layui-form" id="helpSelectTemplateBox" lay-filter="helpSelectTemplateBox"></div>
|
|
<script id="helpSelectTemplate" type="text/html">
|
|
<select id="help" name="help">
|
|
<option value="">请选择帮扶情况</option>
|
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
|
<option value="{{item.dictionaryName}}">{{item.dictionaryName}}</option>
|
|
{{# } }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">居住地址</label>
|
|
<div class="layui-input-block">
|
|
<input type="hidden" id="cultAreaCode" name="cultAreaCode" class="layui-input" value="" maxlength="500">
|
|
<input type="text" id="cultAreaName" readonly style="cursor: pointer" name="cultAreaName" class="layui-input" value="" placeholder="请选择居住地点" maxlength="500">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">采集时间<span style="color: red">*</span></label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="puttime" readonly style="cursor: pointer;" name="puttime" class="layui-input" value="" placeholder="请输入采集时间" maxlength="20">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" pane="">
|
|
<label class="layui-form-label">是否继续邪教</label>
|
|
<div class="layui-input-block">
|
|
<input type="radio" name="docontinue" value="是" title="是">
|
|
<input type="radio" name="docontinue" value="否" title="否">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-layout-admin">
|
|
<div class="layui-input-block">
|
|
<div class="layui-footer" style="left: 0;">
|
|
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
|
|
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="companiesTree" class="companiesTree" style="border:solid 1px #FFFFFF; display: none;background:rgba(6, 39, 88, 1); position: absolute;z-index: 10;height: 250px;overflow: auto;overflow-x: hidden;">
|
|
<ul id="treeDemo" class="ztree" style="width:400px;">
|
|
</ul>
|
|
</div>
|
|
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
|
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
|
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
|
<script src="assets/layuiadmin/layui/layui.js"></script>
|
|
<script>
|
|
layui.config({
|
|
base: 'assets/layuiadmin/' //静态资源所在路径
|
|
}).extend({
|
|
index: 'lib/index' //主入口模块
|
|
}).use(['index', 'form', 'laydate', 'ztree', 'laytpl'], function(){
|
|
var $ = layui.$;
|
|
var form = layui.form;
|
|
var laytpl = layui.laytpl;
|
|
var laydate = layui.laydate;
|
|
var wangEditor = window.wangEditor;
|
|
var wangEditorObj = {};
|
|
var viewerObj = {};
|
|
var populationInfoId = top.restAjax.params(window.location.href).populationInfoId;
|
|
|
|
function closeBox() {
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
}
|
|
|
|
$('#cultAreaName').on("click", function () {
|
|
initAreaTree("cult");
|
|
var cityObj = $(this);
|
|
var cityOffset = cityObj.offset();
|
|
var width = Number(cityObj.width()) + 10;
|
|
$("#companiesTree").css({width: width + "px", left: cityOffset.left + "px", top: cityOffset.top + cityObj.outerHeight() + "px" }).slideDown("fast");
|
|
$("body").bind("mousedown", onBodyDown);
|
|
});
|
|
|
|
function hideMenu() {
|
|
$("#companiesTree").fadeOut("fast");
|
|
$("body").unbind("mousedown", onBodyDown);
|
|
}
|
|
|
|
function onBodyDown(event) {
|
|
if (!(event.target.id == "menuBtn" || event.target.id == "companiesTree" || $(event.target).parents("#companiesTree").length > 0)) {
|
|
hideMenu();
|
|
}
|
|
}
|
|
|
|
function initAreaTree(name) {
|
|
var setting = {
|
|
view: {
|
|
nameIsHTML: true
|
|
},
|
|
data : {
|
|
simpleData : {
|
|
enable : true
|
|
}
|
|
},
|
|
async: {
|
|
enable: true,
|
|
url:"api/areatree/tree",
|
|
autoParam:["id", "name", "pId", "level"]
|
|
},
|
|
callback : {
|
|
onClick : function (e, treeId, treeNode) {
|
|
var count = treeNode.title.split('/').length -1;
|
|
if (count > 0) {
|
|
$('#' + name + "AreaName").val(treeNode.title);
|
|
$('#' + name + "AreaCode").val(treeNode.areaCode);
|
|
hideMenu();
|
|
}else{
|
|
layer.msg("区域选择错误");
|
|
}
|
|
}
|
|
}
|
|
};
|
|
$.fn.zTree.init($("#treeDemo"), setting, null);
|
|
}
|
|
|
|
// 初始化涉邪时间
|
|
function initTime() {
|
|
laydate.render({
|
|
elem: '#time',
|
|
type: 'date',
|
|
value: '',
|
|
trigger: 'click'
|
|
});
|
|
}
|
|
|
|
// 初始化采集时间
|
|
function initPuttime() {
|
|
laydate.render({
|
|
elem: '#puttime',
|
|
type: 'date',
|
|
value: '',
|
|
trigger: 'click'
|
|
});
|
|
}
|
|
|
|
// 初始化涉邪代码下拉选择
|
|
function initTypeSelect() {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/bdcb6fce-feaf-42ac-ba1a-f540ddf60eaf', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('typeSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('typeSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'typeSelectTemplateBox');
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化帮扶情况下拉选择
|
|
function initHelpSelect() {
|
|
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/f8a5c55a-80b7-4eab-acaf-556af87e46c9', []), {}, null, function(code, data, args) {
|
|
laytpl(document.getElementById('helpSelectTemplate').innerHTML).render(data, function(html) {
|
|
document.getElementById('helpSelectTemplateBox').innerHTML = html;
|
|
});
|
|
form.render('select', 'helpSelectTemplateBox');
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
});
|
|
}
|
|
|
|
// 初始化内容
|
|
function initData() {
|
|
initTypeSelect();
|
|
initHelpSelect();
|
|
initTime();
|
|
initPuttime();
|
|
}
|
|
initData();
|
|
|
|
// 提交表单
|
|
form.on('submit(submitForm)', function(formData) {
|
|
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
|
top.dialog.close(index);
|
|
var loadLayerIndex;
|
|
formData.field['populationInfoId'] = populationInfoId;
|
|
top.restAjax.post(top.restAjax.path('api/cult/save', []), formData.field, null, function(code, data) {
|
|
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
|
time: 0,
|
|
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
|
shade: 0.3,
|
|
yes: function(index) {
|
|
top.dialog.close(index);
|
|
window.location.reload();
|
|
},
|
|
btn2: function() {
|
|
closeBox();
|
|
}
|
|
});
|
|
}, function(code, data) {
|
|
top.dialog.msg(data.msg);
|
|
}, function() {
|
|
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
|
}, function() {
|
|
top.dialog.close(loadLayerIndex);
|
|
});
|
|
});
|
|
return false;
|
|
});
|
|
|
|
$('.close').on('click', function() {
|
|
closeBox();
|
|
});
|
|
|
|
// 校验
|
|
form.verify({
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |