新增学校(重点人员、案事件),护路护线(案事件)逻辑关系。

This commit is contained in:
Renpc-kilig 2021-11-23 17:43:00 +08:00
parent 6acd5b166b
commit c2a093d59a
18 changed files with 1080 additions and 18 deletions

View File

@ -33,4 +33,9 @@ public class LineCaseRouteController extends DefaultBaseController {
return new ModelAndView("linecase/list"); return new ModelAndView("linecase/list");
} }
@GetMapping("list-view")
public ModelAndView listView() {
return new ModelAndView("linecase/list-view");
}
} }

View File

@ -33,4 +33,9 @@ public class SchoolKeyRouteController extends DefaultBaseController {
return new ModelAndView("schoolkey/list"); return new ModelAndView("schoolkey/list");
} }
@GetMapping("list-view")
public ModelAndView listView() {
return new ModelAndView("schoolkey/list-view");
}
} }

View File

@ -33,4 +33,9 @@ public class StuTeaSafeRouteController extends DefaultBaseController {
return new ModelAndView("stuteasafe/list"); return new ModelAndView("stuteasafe/list");
} }
@GetMapping("list-view")
public ModelAndView listView() {
return new ModelAndView("stuteasafe/list-view");
}
} }

View File

@ -58,6 +58,8 @@ public class LineCaseDTO {
private String locationCode; private String locationCode;
@ApiModelProperty(name = "grid", value = "所属网格") @ApiModelProperty(name = "grid", value = "所属网格")
private String grid; private String grid;
@ApiModelProperty(name = "lineId", value = "护航弧线ID")
private String lineId;
public String getLineCaseId() { public String getLineCaseId() {
return lineCaseId == null ? "" : lineCaseId.trim(); return lineCaseId == null ? "" : lineCaseId.trim();
@ -234,4 +236,12 @@ public class LineCaseDTO {
public void setGrid(String grid) { public void setGrid(String grid) {
this.grid = grid; this.grid = grid;
} }
public String getLineId() {
return lineId;
}
public void setLineId(String lineId) {
this.lineId = lineId;
}
} }

View File

@ -63,6 +63,8 @@ public class LineCaseVO {
private String locationCode; private String locationCode;
@ApiModelProperty(name = "grid", value = "所属网格") @ApiModelProperty(name = "grid", value = "所属网格")
private String grid; private String grid;
@ApiModelProperty(name = "lineId", value = "护航弧线ID")
private String lineId;
public String getCaseCode() { public String getCaseCode() {
return caseCode == null ? "" : caseCode.trim(); return caseCode == null ? "" : caseCode.trim();
@ -231,4 +233,12 @@ public class LineCaseVO {
public void setGrid(String grid) { public void setGrid(String grid) {
this.grid = grid; this.grid = grid;
} }
public String getLineId() {
return lineId;
}
public void setLineId(String lineId) {
this.lineId = lineId;
}
} }

View File

@ -4,6 +4,7 @@
<resultMap id="lineCaseDTO" type="cn.com.tenlion.systembase.pojo.dtos.linecase.LineCaseDTO"> <resultMap id="lineCaseDTO" type="cn.com.tenlion.systembase.pojo.dtos.linecase.LineCaseDTO">
<result column="line_case_id" property="lineCaseId"/> <result column="line_case_id" property="lineCaseId"/>
<result column="line_id" property="lineId"/>
<result column="case_code" property="caseCode"/> <result column="case_code" property="caseCode"/>
<result column="case_name" property="caseName"/> <result column="case_name" property="caseName"/>
<result column="happen_time" property="happenTime"/> <result column="happen_time" property="happenTime"/>
@ -75,6 +76,7 @@
<insert id="save" parameterType="map"> <insert id="save" parameterType="map">
INSERT INTO data_line_case( INSERT INTO data_line_case(
line_case_id, line_case_id,
line_id,
case_code, case_code,
case_name, case_name,
happen_time, happen_time,
@ -103,6 +105,7 @@
is_delete is_delete
) VALUES( ) VALUES(
#{lineCaseId}, #{lineCaseId},
#{lineId},
#{caseCode}, #{caseCode},
#{caseName}, #{caseName},
#{happenTime}, #{happenTime},
@ -163,6 +166,9 @@
UPDATE UPDATE
data_line_case data_line_case
SET SET
<if test="lineId != null and lineId != ''">
line_id = #{lineId},
</if>
<if test="caseCode != null and caseCode != ''"> <if test="caseCode != null and caseCode != ''">
case_code = #{caseCode}, case_code = #{caseCode},
</if> </if>
@ -236,6 +242,7 @@
<!-- 涉及线、路案(事)件详情 --> <!-- 涉及线、路案(事)件详情 -->
<select id="get" parameterType="map" resultMap="lineCaseDTO"> <select id="get" parameterType="map" resultMap="lineCaseDTO">
SELECT SELECT
t1.line_id,
t1.case_code, t1.case_code,
t1.case_name, t1.case_name,
t1.happen_time, t1.happen_time,
@ -335,6 +342,7 @@
<!-- 涉及线、路案(事)件列表 --> <!-- 涉及线、路案(事)件列表 -->
<select id="list" parameterType="map" resultMap="lineCaseDTO"> <select id="list" parameterType="map" resultMap="lineCaseDTO">
SELECT SELECT
t1.line_id,
t1.line_case_id, t1.line_case_id,
t1.case_code, t1.case_code,
t1.case_name, t1.case_name,
@ -362,6 +370,11 @@
data_line_case t1 data_line_case t1
WHERE WHERE
t1.is_delete = 0 t1.is_delete = 0
<if test="lineId != null and lineId != ''">
AND (
t1.line_id = #{lineId}
)
</if>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
AND ( AND (
t1.case_name LIKE CONCAT('%', #{keywords}, '%') t1.case_name LIKE CONCAT('%', #{keywords}, '%')

View File

@ -229,6 +229,12 @@
} }
return rowData; return rowData;
} }
},
{field: 'lineCase', fixed: 'right', width: 150, title: '涉及线路案(事)件', align:'center',
templet: function(row) {
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="lineCase">案件列表</a>';
return rowData;
}
} }
] ]
], ],
@ -357,6 +363,30 @@
} }
} }
}); });
// 巡查记录
function lineCase(data) {
top.dialog.open({
url: top.restAjax.path('route/linecase/list-view?lineId={lineId}', [data.lineId]),
title: "案(事)件列表",
width: '80%',
height: '80%',
onClose: function() {
reloadTable();
}
});
}
//监听行单击事件
table.on('tool(dataTable)', function(obj){
var data = obj.data;
console.log(data)
// 周边重点人员
if('lineCase' == obj.event) {
lineCase(data);
}
});
}); });
</script> </script>
</body> </body>

View File

@ -0,0 +1,304 @@
<!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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="viewEvent">
<i class="fa fa-lg fa-edit"></i> 查看
</button>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/linecase/listpage?lineId={lineId}';
var lineId = top.restAjax.params(window.location.href).lineId;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, [lineId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
toolbar: '#headerToolBar',
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'caseCode', width: 180, title: '案(事)件编号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseName', width: 180, title: '案(事)件名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenTime', width: 180, title: '发生日期', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenAddress', width: 180, title: '发生地点', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseNatureName', width: 180, title: '案(事)件性质', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseNatureCode', width: 180, title: '案(事)件性质编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseSituation', width: 180, title: '案(事)件情况', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardCodeName', width: 180, title: '主犯(嫌疑人)证件代码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardCodeCode', width: 180, title: '主犯(嫌疑人)证件代码编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardNum', width: 180, title: '主犯(嫌疑人)证件号码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalName', width: 180, title: '主犯(嫌疑人)姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'isSolve', width: 180, title: '是否破案', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'crimeCount', width: 180, title: '作案人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'atLargeCount', width: 180, title: '在逃人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'arrestCount', width: 180, title: '抓捕人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseSolve', width: 180, title: '案件侦破情况', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [lineId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'viewEvent') {
if(checkDatas.length === 0) {
top.dialog.msg('至少选择一条数据');
} else if(checkDatas.length > 1) {
top.dialog.msg('同时只能查看一条数');
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/linecase/update?lineCaseId={lineCaseId}&isView={idView}', [checkDatas[0].lineCaseId, 'view']),
end: function() {
reloadTable();
}
});
}
}
});
});
</script>
</body>
</html>

View File

@ -22,6 +22,18 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item" id="lineDiv">
<label class="layui-form-label">护航弧线<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="lineIdSelectTemplateBox" lay-filter="lineIdSelectTemplateBox"></div>
<script id="lineIdSelectTemplate" type="text/html">
<select id="lineId" name="lineId" lay-filter="lineId" lay-verify="required">
<option value="">请选择护航弧线</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.lineId}}">{{item.lineName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label" style="width: 112px;">案(事)件编号</label> <label class="layui-form-label" style="width: 112px;">案(事)件编号</label>
<div class="layui-input-block" style="margin-left: 112px;"> <div class="layui-input-block" style="margin-left: 112px;">
@ -175,6 +187,19 @@
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
// 初始化学校
function initLineSelect() {
top.restAjax.get(top.restAjax.path('api/line/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('lineIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('lineIdSelectTemplateBox').innerHTML = html;
});
console.log(data)
form.render('select', 'lineIdSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 选择所在地 // 选择所在地
$(document).on('click', '#location', function() { $(document).on('click', '#location', function() {
top.dialog.open({ top.dialog.open({
@ -354,6 +379,7 @@
initCaseSituationRichText(); initCaseSituationRichText();
initCaseSolveRichText(); initCaseSolveRichText();
initGridSelect(); initGridSelect();
initLineSelect();
} }
initData(); initData();

View File

@ -22,6 +22,18 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item" id="lineDiv">
<label class="layui-form-label">护航弧线<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="lineIdSelectTemplateBox" lay-filter="lineIdSelectTemplateBox"></div>
<script id="lineIdSelectTemplate" type="text/html">
<select id="lineId" name="lineId" lay-filter="lineId" lay-verify="required">
<option value="">请选择护航弧线</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.lineId}}">{{item.lineName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label" style="width: 112px;">案(事)件编号</label> <label class="layui-form-label" style="width: 112px;">案(事)件编号</label>
<div class="layui-input-block" style="margin-left: 112px;"> <div class="layui-input-block" style="margin-left: 112px;">
@ -148,7 +160,7 @@
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button> <button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div> </div>
</div> </div>
@ -172,11 +184,28 @@
var laytpl = layui.laytpl; var laytpl = layui.laytpl;
var laydate = layui.laydate; var laydate = layui.laydate;
var lineCaseId = top.restAjax.params(window.location.href).lineCaseId; var lineCaseId = top.restAjax.params(window.location.href).lineCaseId;
var isView = top.restAjax.params(window.location.href).isView;
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
// 初始化组织名称
function initLineSelect(selectValue) {
top.restAjax.get(top.restAjax.path('api/line/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('lineIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('lineIdSelectTemplateBox').innerHTML = html;
});
form.render('select', 'lineIdSelectTemplateBox');
var selectObj = {};
selectObj['lineId'] = selectValue;
form.val('dataForm', selectObj);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 选择所在地 // 选择所在地
$(document).on('click', '#location', function() { $(document).on('click', '#location', function() {
top.dialog.open({ top.dialog.open({
@ -377,6 +406,10 @@
initCaseSituationRichText(data['caseSituation']); initCaseSituationRichText(data['caseSituation']);
initCaseSolveRichText(data['caseSolve']); initCaseSolveRichText(data['caseSolve']);
initGridSelect(data['locationCode'], data['grid']); initGridSelect(data['locationCode'], data['grid']);
initLineSelect(data['lineId']);
if('view' == isView) {
$('#submitBtn').hide();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {

View File

@ -250,13 +250,13 @@
}, },
{field: 'schoolKey', fixed: 'right', width: 150, title: '周边重点人员', align:'center', {field: 'schoolKey', fixed: 'right', width: 150, title: '周边重点人员', align:'center',
templet: function(row) { templet: function(row) {
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="schoolKey">添加重点人员</a>'; var rowData = '<a class="layui-btn layui-btn-xs" lay-event="schoolKey">重点人员列表</a>';
return rowData; return rowData;
} }
}, },
{field: 'stuteasafe', fixed: 'right', width: 150, title: '涉及师生安全案件', align:'center', {field: 'stuteasafe', fixed: 'right', width: 150, title: '涉及师生安全案件', align:'center',
templet: function(row) { templet: function(row) {
var rowData = '<a class="layui-btn layui-btn-xs" lay-event="stuteasafe">添加案件</a>'; var rowData = '<a class="layui-btn layui-btn-xs" lay-event="stuteasafe">案件列表</a>';
return rowData; return rowData;
} }
} }
@ -278,8 +278,8 @@
// 巡查记录 // 巡查记录
function schoolKey(data) { function schoolKey(data) {
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/schoolkey/list?schoolId={schoolId}', [data.schoolId]), url: top.restAjax.path('route/schoolkey/list-view?schoolId={schoolId}', [data.schoolId]),
title: "巡查记录列表", title: "重点人员列表",
width: '80%', width: '80%',
height: '80%', height: '80%',
onClose: function() { onClose: function() {
@ -291,8 +291,8 @@
// 巡查记录 // 巡查记录
function stuteasafe(data) { function stuteasafe(data) {
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/stuteasafe/list?schoolId={schoolId}', [data.schoolId]), url: top.restAjax.path('route/stuteasafe/list-view?schoolId={schoolId}', [data.schoolId]),
title: "巡查记录列表", title: "案(事)件列表",
width: '80%', width: '80%',
height: '80%', height: '80%',
onClose: function() { onClose: function() {

View File

@ -0,0 +1,187 @@
<!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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="viewEvent">
<i class="fa fa-lg fa-edit"></i> 查看
</button>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/schoolkey/listpage?schoolId={schoolId}';
var schoolId = top.restAjax.params(window.location.href).schoolId;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, [schoolId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
toolbar: '#headerToolBar',
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'degreeOfHarmName', width: 180, title: '危害程度', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'degreeOfHarmCode', width: 180, title: '危害程度编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'isFollow', width: 180, title: '是否关注', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [schoolId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg('请选择要查看的数据');
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/schoolkey/update?schoolKeyId={schoolKeyId}&isView={isView}', [checkDatas[0].schoolKeyId, 'view']),
end: function() {
reloadTable();
}
});
}
}
});
});
</script>
</body>
</html>

View File

@ -87,6 +87,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item" id="schoolDiv">
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
<script id="schoolIdSelectTemplate" type="text/html">
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
<option value="">请选择学校</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item layui-row"> <div class="layui-form-item layui-row">
<div class="layui-col-lg6"> <div class="layui-col-lg6">
<label class="layui-form-label">所在地</label> <label class="layui-form-label">所在地</label>
@ -159,7 +171,19 @@
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
var schoolId = top.restAjax.params(window.location.href).schoolId;
// 初始化学校
function initSchoolSelect() {
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
});
console.log(data)
form.render('select', 'schoolIdSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 选择所在地 // 选择所在地
$(document).on('click', '#location', function() { $(document).on('click', '#location', function() {
@ -289,6 +313,7 @@
function initData() { function initData() {
initDegreeOfHarmSelect(); initDegreeOfHarmSelect();
initGridSelect(); initGridSelect();
initSchoolSelect();
} }
initData(); initData();
@ -302,7 +327,6 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; var loadLayerIndex;
formData.field['schoolId'] = schoolId;
top.restAjax.post(top.restAjax.path('api/schoolkey/save', []), formData.field, null, function(code, data) { top.restAjax.post(top.restAjax.path('api/schoolkey/save', []), formData.field, null, function(code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,

View File

@ -87,6 +87,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item" id="schoolDiv">
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
<script id="schoolIdSelectTemplate" type="text/html">
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
<option value="">请选择学校</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item layui-row"> <div class="layui-form-item layui-row">
<div class="layui-col-lg6"> <div class="layui-col-lg6">
<label class="layui-form-label">所在地</label> <label class="layui-form-label">所在地</label>
@ -133,7 +145,7 @@
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button> <button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div> </div>
</div> </div>
@ -162,6 +174,22 @@
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
// 初始化组织名称
function initSchoolSelect(selectValue) {
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
});
form.render('select', 'schoolIdSelectTemplateBox');
var selectObj = {};
selectObj['schoolId'] = selectValue;
form.val('dataForm', selectObj);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 选择所在地 // 选择所在地
$(document).on('click', '#location', function() { $(document).on('click', '#location', function() {
top.dialog.open({ top.dialog.open({
@ -307,6 +335,10 @@
initDegreeOfHarmSelect(data['degreeOfHarm'] + ',' + data['degreeOfHarmCode']); initDegreeOfHarmSelect(data['degreeOfHarm'] + ',' + data['degreeOfHarmCode']);
queryBasePopulationInfo(data['cardNum']); queryBasePopulationInfo(data['cardNum']);
initGridSelect(data['locationCode'], data['grid']); initGridSelect(data['locationCode'], data['grid']);
initSchoolSelect(data['schoolId']);
if('view' == isView) {
$('#submitBtn').hide();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {

View File

@ -0,0 +1,322 @@
<!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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="viewEvent">
<i class="fa fa-lg fa-edit"></i> 查看
</button>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/stuteasafe/listpage?schoolId={schoolId}';
var schoolId = top.restAjax.params(window.location.href).schoolId;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, [schoolId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
toolbar: '#headerToolBar',
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'caseCode', width: 180, title: '案(事)件编号', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseName', width: 180, title: '案(事)件名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenTime', width: 180, title: '发生日期', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenLocationName', width: 180, title: '发案地', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenLocationCode', width: 180, title: '发案地编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'happenAddress', width: 180, title: '发生地点', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseNatureName', width: 180, title: '案(事)件性质', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseNatureCode', width: 180, title: '案(事)件性质编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseSituation', width: 180, title: '案件情况', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardCodeName', width: 180, title: '主犯(嫌疑人)证件代码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardCodeCode', width: 180, title: '主犯(嫌疑人)证件代码编码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalCardNum', width: 180, title: '主犯(嫌疑人)证件号码', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'principalName', width: 180, title: '主犯(嫌疑人)姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'isSolve', width: 180, title: '是否破案', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'crimeCount', width: 180, title: '作案人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'atLargeCount', width: 180, title: '在逃人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'arrestCount', width: 180, title: '抓捕人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'caseSolve', width: 180, title: '案件侦破情况', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
}
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [schoolId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'viewEvent') {
if(checkDatas.length === 0) {
top.dialog.msg('至少选择一条数据');
} else if(checkDatas.length > 1) {
top.dialog.msg('同时只能查看一条数');
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/stuteasafe/update?stuTeaSafeId={stuTeaSafeId}&isView={isView}', [checkDatas[0].stuTeaSafeId, 'view']),
end: function() {
reloadTable();
}
});
}
}
});
});
</script>
</body>
</html>

View File

@ -65,15 +65,14 @@
var laydate = layui.laydate; var laydate = layui.laydate;
var common = layui.common; var common = layui.common;
var resizeTimeout = null; var resizeTimeout = null;
var tableUrl = 'api/stuteasafe/listpage?schoolId={schoolId}'; var tableUrl = 'api/stuteasafe/listpage';
var schoolId = top.restAjax.params(window.location.href).schoolId;
// 初始化表格 // 初始化表格
function initTable() { function initTable() {
table.render({ table.render({
elem: '#dataTable', elem: '#dataTable',
id: 'dataTable', id: 'dataTable',
url: top.restAjax.path(tableUrl, [schoolId]), url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '', width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90, height: $win.height() - 90,
limit: 20, limit: 20,
@ -265,7 +264,7 @@
// 重载表格 // 重载表格
function reloadTable(currentPage) { function reloadTable(currentPage) {
table.reload('dataTable', { table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [schoolId]), url: top.restAjax.path(tableUrl, []),
where: { where: {
keywords: $('#keywords').val(), keywords: $('#keywords').val(),
startTime: $('#startTime').val(), startTime: $('#startTime').val(),
@ -337,7 +336,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, anim: 2,
content: top.restAjax.path('route/stuteasafe/save?schoolId={schoolId}', [schoolId]), content: top.restAjax.path('route/stuteasafe/save', []),
end: function() { end: function() {
reloadTable(); reloadTable();
} }

View File

@ -22,6 +22,18 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item" id="schoolDiv">
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
<script id="schoolIdSelectTemplate" type="text/html">
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
<option value="">请选择学校</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label" style="width: 113px;">案(事)件编号</label> <label class="layui-form-label" style="width: 113px;">案(事)件编号</label>
<div class="layui-input-block" style="margin-left: 113px;"> <div class="layui-input-block" style="margin-left: 113px;">
@ -174,7 +186,19 @@
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
var schoolId = top.restAjax.params(window.location.href).schoolId;
// 初始化学校
function initSchoolSelect() {
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
});
console.log(data)
form.render('select', 'schoolIdSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化备注富文本 // 初始化备注富文本
function initCaseSituationRichText() { function initCaseSituationRichText() {
@ -354,6 +378,7 @@
initCaseSituationRichText(); initCaseSituationRichText();
initCaseSolveRichText(); initCaseSolveRichText();
initGridSelect(); initGridSelect();
initSchoolSelect();
} }
initData(); initData();
@ -378,7 +403,6 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; var loadLayerIndex;
formData.field['schoolId'] = schoolId;
top.restAjax.post(top.restAjax.path('api/stuteasafe/save', []), formData.field, null, function(code, data) { top.restAjax.post(top.restAjax.path('api/stuteasafe/save', []), formData.field, null, function(code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,

View File

@ -22,6 +22,18 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item" id="schoolDiv">
<label class="layui-form-label">学校<span style="color: red;vertical-align: middle;">*</span></label>
<div class="layui-input-block layui-form" id="schoolIdSelectTemplateBox" lay-filter="schoolIdSelectTemplateBox"></div>
<script id="schoolIdSelectTemplate" type="text/html">
<select id="schoolId" name="schoolId" lay-filter="schoolId" lay-verify="required">
<option value="">请选择学校</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.schoolId}}">{{item.schoolName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label" style="width: 113px;">案(事)件编号</label> <label class="layui-form-label" style="width: 113px;">案(事)件编号</label>
<div class="layui-input-block" style="margin-left: 113px;"> <div class="layui-input-block" style="margin-left: 113px;">
@ -148,7 +160,7 @@
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <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" lay-submit lay-filter="submitForm" id="submitBtn">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button> <button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div> </div>
</div> </div>
@ -172,11 +184,28 @@
var laytpl = layui.laytpl; var laytpl = layui.laytpl;
var laydate = layui.laydate; var laydate = layui.laydate;
var stuTeaSafeId = top.restAjax.params(window.location.href).stuTeaSafeId; var stuTeaSafeId = top.restAjax.params(window.location.href).stuTeaSafeId;
var isView = top.restAjax.params(window.location.href).isView;
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var viewerObj = {}; var viewerObj = {};
// 初始化组织名称
function initSchoolSelect(selectValue) {
top.restAjax.get(top.restAjax.path('api/school/list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('schoolIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('schoolIdSelectTemplateBox').innerHTML = html;
});
form.render('select', 'schoolIdSelectTemplateBox');
var selectObj = {};
selectObj['schoolId'] = selectValue;
form.val('dataForm', selectObj);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化备注富文本 // 初始化备注富文本
function initCaseSituationRichText(value) { function initCaseSituationRichText(value) {
var editor = new wangEditor('#caseSituation'); var editor = new wangEditor('#caseSituation');
@ -377,6 +406,10 @@
initCaseSituationRichText(data['caseSituation']); initCaseSituationRichText(data['caseSituation']);
initCaseSolveRichText(data['caseSolve']); initCaseSolveRichText(data['caseSolve']);
initGridSelect(data['happenLocationCode'], data['grid']); initGridSelect(data['happenLocationCode'], data['grid']);
initSchoolSelect(data['schoolId']);
if('view' == isView) {
$('#submitBtn').hide();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {