You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
440 lines
16 KiB
440 lines
16 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../../component/layui/css/layui.css" />
|
|
<link rel="stylesheet" href="../../../component/pear/css/module/toast.css" />
|
|
|
|
<style>
|
|
.layui-table-cell {
|
|
height: 50px;
|
|
line-height: 40px;
|
|
}
|
|
|
|
th {
|
|
color: #303133;
|
|
background-color: #f5f7fa;
|
|
}
|
|
|
|
.layui-card {
|
|
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0) !important;
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.layui-form-item {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.layui-table td,
|
|
.layui-table th {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.bp {
|
|
background-color: rgba(23, 179, 163, .1);
|
|
padding: 5px 10px;
|
|
height: 32px;
|
|
line-height: 30px;
|
|
font-size: 12px;
|
|
color: #17b3a3;
|
|
border-radius: 4px;
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
border: 1px solid rgba(23, 179, 163, .2);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.xp {
|
|
background-color: rgba(144, 147, 153, .1);
|
|
padding: 5px 10px;
|
|
height: 32px;
|
|
line-height: 30px;
|
|
font-size: 12px;
|
|
color: #909399;
|
|
border-radius: 4px;
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
border: 1px solid rgba(144, 147, 153, .2);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.layui-form-item .layui-input-inline {
|
|
float: left;
|
|
width: 190px;
|
|
margin-right: 1px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="layui-form">
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">行政区划:</label>
|
|
<div class="layui-input-inline" id="xzqhView"></div>
|
|
|
|
<script id="xzqhScript" type="text/html">
|
|
<select id="xzqhId" lay-filter="xzqh">
|
|
<option value="">全部</option>
|
|
{{# layui.each(d, function(index, item){ }}
|
|
<option value="{{item.id}}">{{item.area_name}}</option>
|
|
{{# }); }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">学校类型:</label>
|
|
<div class="layui-input-inline" id="xxlxView" style="width: 130px;"></div>
|
|
|
|
<script id="xxlxScript" type="text/html">
|
|
<select id="xxlxId" lay-filter="xxlx">
|
|
{{# layui.each(d, function(index, item){ }}
|
|
<option value="{{item.school_type_id}}">{{item.school_type_name}}</option>
|
|
{{# }); }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">学科:</label>
|
|
<div class="layui-input-inline" id="kmView" style="width: 130px;">
|
|
</div>
|
|
<script id="kmScript" type="text/html">
|
|
<select id="kmId" lay-filter="km">
|
|
{{# layui.each(d, function(index, item){ }}
|
|
<option value="{{item.km_code}}">{{item.km_name}}</option>
|
|
{{# }); }}
|
|
</select>
|
|
</script>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">分类:</label>
|
|
<div class="layui-input-inline" id="fenlei" style="width: 245px;">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">数量:</label>
|
|
<div class="layui-input-inline" id="fenlei" style="width: 125px;">
|
|
<select id="sl" lay-filter="sl">
|
|
<option value="-1">全部</option>
|
|
<option value="0">等于0</option>
|
|
<option value="1">大于0</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">配备要求:</label>
|
|
<div class="layui-input-inline" style="width:125px">
|
|
<select id="pbyqId" lay-filter="pbyq">
|
|
<option value="0">全部</option>
|
|
<option value="1">必配</option>
|
|
<option value="2">选配</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-form-item" style="margin-top: 10px;">
|
|
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: auto;">学校名称:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" lay-affix="clear" id="xxmc" placeholder="请输入学校名称" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-inline" style="margin-left: 14px;">
|
|
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="user-query">
|
|
<i class="layui-icon layui-icon-search"></i>
|
|
查询
|
|
</button>
|
|
</div>
|
|
|
|
<button class="layui-btn layui-btn-sm layui-bg-orange" lay-submit lay-filter="export"
|
|
style="position: fixed;right: 20px;top:60px">
|
|
<i class="layui-icon layui-icon-download-circle"></i>
|
|
导出
|
|
</button>
|
|
|
|
<table class="layui-table" id="myTable"></table>
|
|
<script type="text/html" id="pbyq_templet">
|
|
|
|
{{# if(d.bp_xp > 0){ }}
|
|
<span class="bp">必配</span>
|
|
{{# } else { }}
|
|
<span class="xp">选配</span>
|
|
{{# } }}
|
|
|
|
</script>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
<script src="../../../component/pear/xm-select.js"></script>
|
|
|
|
<script>
|
|
layui.use(function () {
|
|
var $ = layui.jquery;
|
|
var table = layui.table;
|
|
var toast = layui.toast;
|
|
var form = layui.form;
|
|
var laytpl = layui.laytpl;
|
|
|
|
var xmSelectData = [];
|
|
|
|
var xmSelectArr = [];
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: "/dsBase/zbdc/getXzqhList",
|
|
success: function (res) {
|
|
var xzqhTpl = xzqhScript.innerHTML,
|
|
xzqhView = document.getElementById('xzqhView');
|
|
laytpl(xzqhTpl).render(res.data, function (html) {
|
|
xzqhView.innerHTML = html;
|
|
});
|
|
form.render();
|
|
}
|
|
});
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: "/dsBase/zbdc/getCurrentPersonAreaInfo",
|
|
success: function (res) {
|
|
if (res.shi_master != 1) {
|
|
|
|
$("#xzqhId").val(res.area_id);
|
|
$("#xzqhId").prop('disabled', true);
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: "/dsBase/zbdc/getQuerySchoolType",
|
|
success: function (res) {
|
|
var xxlxTpl = xxlxScript.innerHTML,
|
|
xxlxView = document.getElementById('xxlxView');
|
|
laytpl(xxlxTpl).render(res.data, function (html) {
|
|
xxlxView.innerHTML = html;
|
|
});
|
|
getKm();
|
|
|
|
}
|
|
});
|
|
|
|
function getKm() {
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: "/dsBase/zbdc/getKm?school_type_id=" + $("#xxlxId").val(),
|
|
success: function (res) {
|
|
var kmTpl = kmScript.innerHTML,
|
|
kmView = document.getElementById('kmView');
|
|
laytpl(kmTpl).render(res.data, function (html) {
|
|
kmView.innerHTML = html;
|
|
});
|
|
form.render();
|
|
getXmSelect();
|
|
tableRender();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function getXmSelect() {
|
|
var fenleiSelect = xmSelect.render({
|
|
el: '#fenlei',
|
|
clickClose: true,
|
|
radio: true,
|
|
autoRow: true,
|
|
model: {
|
|
icon: 'hidden'
|
|
},
|
|
tree: {
|
|
show: true,
|
|
showFolderIcon: true,
|
|
showLine: true,
|
|
indent: 20,
|
|
strict: false,
|
|
simple: true,
|
|
expandedKeys: [-3],
|
|
clickCheck: true,
|
|
clickExpand: false,
|
|
},
|
|
data: [],
|
|
prop: {
|
|
value: "id",
|
|
name: "level_name"
|
|
},
|
|
on: function (data) {
|
|
xmSelectArr = data.arr;
|
|
tableRender();
|
|
}
|
|
});
|
|
$.ajax({
|
|
type: 'GET',
|
|
async: false,
|
|
url: '/dsBase/zbdc/getKmFeiLeiTree?km_code=' + $("#kmId").val(),
|
|
success: function (res) {
|
|
xmSelectData = res.data;
|
|
fenleiSelect.update({
|
|
data: res.data
|
|
});
|
|
fenleiSelect.changeExpandedKeys(true);
|
|
}
|
|
});
|
|
}
|
|
|
|
form.on('select(xzqh)', function () {
|
|
tableRender();
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
form.on('select(xxlx)', function () {
|
|
getKm();
|
|
tableRender();
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
form.on('select(km)', function (data) {
|
|
getXmSelect();
|
|
tableRender();
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
form.on('select(sl)', function () {
|
|
tableRender();
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
form.on('select(pbyq)', function (data) {
|
|
tableRender();
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
function findNodeAndParents(levelName) {
|
|
function search(node, path) {
|
|
const newPath = [...path, node.level_name];
|
|
if (node.level_name === levelName) {
|
|
return newPath;
|
|
}
|
|
if (node.children) {
|
|
for (const child of node.children) {
|
|
const result = search(child, newPath);
|
|
if (result) {
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
for (const root of xmSelectData) {
|
|
const result = search(root, []);
|
|
if (result) {
|
|
return result;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
form.on('submit(user-query)', function () {
|
|
|
|
tableRender();
|
|
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
form.on('submit(export)', function () {
|
|
var fenlei_name = "";
|
|
|
|
if (xmSelectArr.length > 0) {
|
|
const levelName = xmSelectArr[0].level_name;
|
|
const result = findNodeAndParents(levelName);
|
|
fenlei_name = result.join(',');
|
|
}
|
|
var url = "/dsBase/zbdc/getQueryYqsb?export_flag=1&page=1&limit=50000&type_id=" + $("#sl").val() + "&level_filter=" + fenlei_name + "&pbyq=" + $("#pbyqId").val() + "&km_code=" + $("#kmId").val() + "&area_id=" + $("#xzqhId").val() + "&school_type_id=" + $("#xxlxId").val() + "&keyword=" + $("#xxmc").val();
|
|
window.location.href = url;
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
|
|
function tableRender() {
|
|
|
|
var fenlei_name = "";
|
|
|
|
if (xmSelectArr.length > 0) {
|
|
const levelName = xmSelectArr[0].level_name;
|
|
const result = findNodeAndParents(levelName);
|
|
fenlei_name = result.join(',');
|
|
}
|
|
|
|
table.render({
|
|
elem: '#myTable',
|
|
url: '/dsBase/zbdc/getQueryYqsb',
|
|
where: {
|
|
area_id: $("#xzqhId").val(),
|
|
school_type_id: $("#xxlxId").val(),
|
|
km_code: $("#kmId").val(),
|
|
pbyq: $("#pbyqId").val(),
|
|
level_filter: fenlei_name,
|
|
keyword: $("#xxmc").val(),
|
|
type_id: $("#sl").val()
|
|
},
|
|
cellExpandedMode: "tips",
|
|
height: 'full-120',
|
|
page: {
|
|
limit: 15
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
cols: [[
|
|
{ title: '序号', fixed: 'left', align: 'center', width: "5%", type: 'numbers' },
|
|
{ title: '行政区域', fixed: 'left', field: 'area_name', align: 'center', width: "150" },
|
|
{ title: '学校名称', fixed: 'left', field: 'bureau_name', align: 'center', width: "300" },
|
|
{ title: '学校类型', field: 'school_type_name', align: 'center', width: "125" },
|
|
{ title: '分类', field: 'level', align: 'center', width: "255" },
|
|
{ title: '名称', field: 'mc', align: 'center', width: "150" },
|
|
{ title: '规格型号功能', field: 'ggxhgn', align: 'center', width: "380" },
|
|
{ title: '单位', field: 'dw', align: 'center', width: "100" },
|
|
{ title: '应配数量', field: 'ypsl', align: 'center', width: "100" },
|
|
{ title: '配备要求', align: 'center', width: "100", templet: '#pbyq_templet' },
|
|
//{ title: '备注', field: 'bz', align: 'center', width: "10%" },
|
|
{ title: '现有数量', fixed: 'right', field: 'xysl', align: 'center', width: "100" }
|
|
|
|
]],
|
|
// skin: 'line',
|
|
defaultToolbar: []
|
|
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |