main
kgdxpr 2 years ago
parent de40abe434
commit 37394134b8

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

@ -144,9 +144,9 @@
var jobId = GetQueryString("job_id");
laydate.render({
elem: '#endDate',
elem: '#endDate',
min: 0
});
});
renderBureauTable();
@ -225,13 +225,18 @@
elem: '#group-table',
id: 'groupTable',
url: '/QingLong/collect/listGroup',
height: 'full-180',
cols: [[
{ type: 'checkbox', width: "5%" },
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '分名称', field: 'group_name', align: 'center' },
{ title: '分名称', field: 'group_name', align: 'center' },
{ title: '操作', toolbar: '#group-bar', align: 'center', width: "25%" }
]],
page: {
limit: 5
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
skin: 'line',
defaultToolbar: []
});

@ -85,7 +85,7 @@
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-tab-item layui-show">
<span>
<input type="checkbox" id="syjs" lay-skin="tag" title="所有教师" class="kj1">
</span>
@ -106,7 +106,7 @@
<div style="display: flex;align-items:flex-end;margin-bottom: 10px;">
<div class="layui-input-inline" style="width: auto;">
<div class="layui-btn-container tag" lay-filter="orgs" lay-allowclose="true"
style="border-style:dashed;border-width:1px;border-color: #CCCCCC;height: 100px;width: 545px;padding: 10px;overflow: auto;">
style="border-style:dashed;border-width:1px;border-color: #CCCCCC;height: 100px;width: 714px;padding: 10px;overflow: auto;">
</div>
</div>
<div class="layui-input-inline" style="width: auto;">
@ -116,25 +116,29 @@
</div>
<div class="layui-row layui-col-space10">
<div class="layui-col-md3">
<div class="grid-demo" style="border: 1px solid #EEEEEE;height: 320px;">
<div class='ztree' id='mytree'></div>
<div class="grid-demo" style="border: 1px solid #EEEEEE;height: 375px;">
<div class='ztree' id='mytree' style="margin: 10px;"></div>
</div>
</div>
<div class="layui-col-md9">
<div class="grid-demo grid-demo-bg1"
style="border: 1px solid #EEEEEE;height: 320px;">
style="border: 1px solid #EEEEEE;height: 375px;">
<div class="layui-table-tool"
style="min-height: 38px !important;width: 300px;margin-left: 10px;">
<div class="layui-input-group" style="margin-left: -16px;">
style="min-height: 38px !important;width: 580px;">
<div class="layui-input-group">
<input type="text" id="person_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">
style="cursor: pointer;" lay-on="search">
<i class="layui-icon layui-icon-search"></i>
</div>
</div>
</div>
<table id="data-table"></table>
<script type="text/html" id="select-enable">
<input type="checkbox" id="{{d.person_id}}" lay-skin="switch" lay-text="已选|未选" lay-filter="switchEnable"
{{ d.sw == true ? "checked" : "" }}>
</script>
</div>
</div>
</div>
@ -147,7 +151,14 @@
</span>
<div class="layui-tab-item">
4
<div id="tableDiv" style="width: 650px;">
<table id="group-table"></table>
<script type="text/html" id="group-bar">
<button type="button" class="pear-btn pear-btn-danger pear-btn-xs" lay-event="delGroup">
<i class="layui-icon layui-icon-delete"></i> 删除
</button>
</script>
</div>
</div>
</div>
@ -191,9 +202,6 @@
var classIds = [];
var publishData = {}
var jobId = GetQueryString("job_id");
$.ajax({
@ -241,13 +249,17 @@
});
form.render();
}
}
});
form.on('submit(publish)', function (data) {
var checkStatus = table.checkStatus('groupTable');
var groupIds = checkStatus.data.map(function (item) {
return item.group_id;
});
var allTeacher = 0;
var allStudent = 0;
@ -273,11 +285,13 @@
publishData.njIds = njCheckedIds.join(",");
publishData.personIds = personIds.join(",");
publishData.classIds = classIds.join(",");
publishData.groupIds = groupIds.join(",");
publishData.deadline_time = data.field.deadline_time;
publishData.memo = data.field.memo;
console.log(publishData);
$.ajax({
url: '/QingLong/collect/ForwardJob',
type: 'post',
@ -320,7 +334,7 @@
}
},
callback: {
// onClick: zTreeOnClick,
onClick: zTreeOnClick,
}
};
@ -331,9 +345,11 @@
dataType: "json",
success: function (res) {
if (res.code == 0) {
orgId = res.data.filter(item => item.parent_id === "0").map(item => item.org_id);
var orgIdArr = res.data.filter(item => item.parent_id === "0").map(item => item.org_id);
orgId = orgIdArr.join(',');
var zTreeObj = $.fn.zTree.init($("#mytree"), ztreeSetting, res.data);
zTreeObj.expandAll(true);
}
}
});
@ -347,10 +363,10 @@
url: '/QingLong/collect/getOrgPersonList',
where: {
org_id: orgId,
query_type_id: 2,
org_name: $("#org_name").val()
keyword: $("#person_name").val()
},
// height: '374',
width: '610',
page: {
limit: 5
, layout: ['count', 'prev', 'page', 'next', 'skip']
@ -359,8 +375,8 @@
},
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '教师姓名', field: 'org_name', align: 'center' },
{ title: '性别', field: 'org_type_name', align: 'center', width: "20%" },
{ title: '教师姓名', field: 'person_name', align: 'center' },
{ title: '性别', field: 'xb_name', align: 'center', width: "20%" },
{ title: '操作', align: 'center', width: "25%", templet: '#select-enable' }
]],
skin: 'line',
@ -369,21 +385,10 @@
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
if (data[i].xb == 1) {
data[i].xb_name = "男";
} else {
data[i].xb_name = "女";
}
}
return res;
@ -400,18 +405,113 @@
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);
tag.add('orgs', { text: data.person_name, id: data.person_id });
personIds.push(data.person_id);
}
else {
tag.delete('orgs', data.org_id);
tag.delete('orgs', data.person_id);
}
});
}
});
}
function zTreeOnClick(event, treeId, treeNode) {
orgId = treeNode.org_id;
renderPersonTable();
}
tag.on('delete(orgs)', function (data) {
var personId = data.elem.prevObject.prevObject[0].getAttribute("lay-id");
personIds = personIds.filter(item => item !== personId);
var switchElem = $('#' + personId);
switchElem.prop('checked', false);
form.render();
});
util.on({
search: function () {
renderPersonTable();
},
saveGroup: function () {
if (Array.isArray(personIds) && personIds.length === 0) {
layer.msg("请先选择人员!", {
icon: 2,
time: 1500
});
} else {
layer.open({
type: 2,
title: '保存分组',
shadeClose: true,
shade: 0,
area: ['600px', '200px'],
content: '../org/save_group.html?bureau_ids=' + personIds.join(",")
});
}
}
});
form.on('input-affix(clear)', function (data) {
renderPersonTable();
});
//分组表格
table.render({
elem: '#group-table',
id: 'groupTable',
url: '/QingLong/collect/listGroup',
cols: [[
{ type: 'checkbox', width: "5%" },
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '分组名称', field: 'group_name', align: 'center' },
{ title: '操作', toolbar: '#group-bar', align: 'center', width: "25%" }
]],
page: {
limit: 5
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
skin: 'line',
defaultToolbar: []
});
table.on('tool(groupTable)', function (obj) {
if (obj.event === 'delGroup') {
layer.confirm('确定要删除吗?', {
icon: 3,
title: '提示'
}, function (index) {
$.ajax({
url: '/QingLong/collect/delGroup',
type: 'post',
data: { group_id: obj.data.group_id },
success: function (result) {
if (result.success) {
layer.msg("删除成功!", {
icon: 1,
time: 1000
}, function () {
groupTableReload()
});
} else {
layer.msg(result.message, {
icon: 2,
time: 2000
});
}
}
});
});
}
});
function groupTableReload() {
table.reloadData('groupTable', {
scrollPos: false
});
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");

Loading…
Cancel
Save