黄海 2 years ago
commit 5b97799d69

@ -86,8 +86,26 @@
</div>
</div>
<div id="tableDiv" style="width: 650px;">
<div class="layui-table-tool" style="min-height: 38px !important">
<div class="layui-input-inline"
style="margin-left: -16px;width: 150px !important;">
<select id="orgTypeId" lay-filter="orgTypeId">
<option value="-1">全部</option>
<option value="16">学校</option>
<option value="14">教辅单位</option>
</select>
</div>
<div class="layui-input-group" style="margin-left: -16px;">
<input type="text" id="org_name" placeholder="请输入单位名称"
class="layui-input" lay-affix="clear" lay-filter="clear">
<div class="layui-input-split layui-input-suffix"
style="cursor: pointer;" lay-on="confirm">
<i class="layui-icon layui-icon-search"></i>
</div>
</div>
</div>
<table id="data-table"></table>
<script type="text/html" id="table-toolbar">
<!-- <script type="text/html" id="table-toolbar">
<div class="layui-input-inline" style="margin-left: -16px;width: 150px !important;">
<select id="orgTypeId" lay-filter="orgTypeId">
<option value="-1">全部</option>
@ -101,7 +119,7 @@
<i class="layui-icon layui-icon-search"></i>
</div>
</div>
</script>
</script> -->
<script type="text/html" id="select-enable">
<input type="checkbox" id="{{d.org_id}}" lay-skin="switch" lay-text="已选|未选" lay-filter="switchEnable"
{{ d.sw == true ? "checked" : "" }}>
@ -178,77 +196,79 @@
}
});
renderBureauTable();
function renderBureauTable() {
table.render({
elem: '#data-table',
id: 'myTable',
url: '/QingLong/collect/getBureauList',
where: {
org_type_id: $("#orgTypeId").val(),
query_type_id: 2,
exclude_self: 1,
org_name: $("#org_name").val()
},
// height: '374',
page: {
limit: 5
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '单位名称', field: 'org_name', align: 'center' },
{ title: '单位类型', field: 'org_type_name', align: 'center', width: "20%" },
{ title: '操作', align: 'center', width: "25%", templet: '#select-enable' }
]],
skin: 'line',
toolbar: '#table-toolbar',
defaultToolbar: [],
parseData: function (res) {
var data = res.data;
for (var i = 0; i < data.length; i++) {
switch (data[i].org_type_id) {
case 14:
res.data[i].org_type_name = '教辅单位';
break;
case 16:
res.data[i].org_type_name = '学校';
break;
default:
res.data[i].org_type_name = '--';
break;
}
table.render({
elem: '#data-table',
id: 'myTable',
url: '/QingLong/collect/getBureauList',
where: {
org_type_id: "-1",
query_type_id: 2,
exclude_self: 1,
org_name: $("#org_name").val()
},
// height: '374',
page: {
limit: 5
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '单位名称', field: 'org_name', align: 'center' },
{ title: '单位类型', field: 'org_type_name', align: 'center', width: "20%" },
{ title: '操作', align: 'center', width: "25%", templet: '#select-enable' }
]],
skin: 'line',
toolbar: '#table-toolbar',
defaultToolbar: [],
parseData: function (res) {
var data = res.data;
for (var i = 0; i < data.length; i++) {
switch (data[i].org_type_id) {
case 14:
res.data[i].org_type_name = '教辅单位';
break;
case 16:
res.data[i].org_type_name = '学校';
break;
default:
res.data[i].org_type_name = '--';
break;
}
res.data[i].sw = false
if (bureauIds.includes(data[i].org_id)) {
res.data[i].sw = true
res.data[i].sw = false
if (bureauIds.includes(data[i].org_id)) {
res.data[i].sw = true
}
}
return res;
},
done: function (res, curr, count) {
var options = this;
// 获取当前行数据
table.getRowData = function (tableId, elem) {
var index = $(elem).closest('tr').data('index');
return table.cache[tableId][index] || {};
};
form.on('switch(switchEnable)', function (obj) {
var data = table.getRowData(options.id, this);
if (obj.elem.checked) {
tag.add('orgs', { text: data.org_name, id: data.org_id });
bureauIds.push(data.org_id);
}
else {
tag.delete('orgs', data.org_id);
}
});
}
return res;
},
done: function (res, curr, count) {
var options = this;
// 获取当前行数据
table.getRowData = function (tableId, elem) {
var index = $(elem).closest('tr').data('index');
return table.cache[tableId][index] || {};
};
form.on('switch(switchEnable)', function (obj) {
var data = table.getRowData(options.id, this);
if (obj.elem.checked) {
tag.add('orgs', { text: data.org_name, id: data.org_id });
bureauIds.push(data.org_id);
}
else {
tag.delete('orgs', data.org_id);
}
});
}
});
});
}
table.render({
elem: '#group-table',
@ -335,15 +355,16 @@
});
function tableReload() {
table.reloadData('myTable', {
where: {
query_type_id: 2,
exclude_self: 1,
org_type_id: $("#orgTypeId").val(),
org_name: $("#org_name").val()
},
scrollPos: false
});
renderBureauTable();
// table.reloadData('myTable', {
// where: {
// query_type_id: 2,
// exclude_self: 1,
// org_type_id: $("#orgTypeId").val(),
// org_name: $("#org_name").val()
// },
// scrollPos: false
// });
}
function groupTableReload() {
@ -387,11 +408,11 @@
publishData.job_id = jobId;
publishData.xiaShuSchool = xiaShuSchool;
publishData.xiaShuJiaoFu = xiaShuJiaoFu;
publishData.xiaShuJiaoFu = xiaShuJiaoFu;
publishData.bureauIds = bureauIds.join(",");
publishData.groupIds = groupIds.join(",");
publishData.deadline_time = data.field.deadline_time;
publishData.memo = data.field.memo;
publishData.memo = data.field.memo;
$.ajax({
url: '/QingLong/collect/ForwardJob',
@ -422,7 +443,7 @@
window.publish_save = function (param) {
}

@ -75,10 +75,10 @@
<div class="layui-input-inline"
style="margin-left: -16px;width: 150px !important;">
<select id="orgTypeId" lay-filter="orgTypeId">
<option value="-1">全部</option>
<option value="5">市直教辅单位</option>
<option value="9">市直学校</option>
<option value="11">区县教育局</option>
<option value="1,2,3">全部</option>
<option value="1">区县教育局</option>
<option value="2">市直学校</option>
<option value="3">市直教辅单位</option>
</select>
</div>
<div class="layui-input-group" style="margin-left: -16px;">
@ -173,10 +173,9 @@
id: 'myTable',
url: '/QingLong/collect/getBureauList',
where: {
org_type_id: $("#orgTypeId").val(),
bureau_type_ids: $("#orgTypeId").val(),
org_name: $("#org_name").val(),
query_type_id: 1,
exclude_self: 1
query_type_id: 1,
},
// height: '374',
page: {

Loading…
Cancel
Save