From 37394134b8f4a6796c5caff7bcfd923bb09347d8 Mon Sep 17 00:00:00 2001 From: kgdxpr Date: Thu, 18 Jan 2024 10:23:37 +0800 Subject: [PATCH] 'commit' --- WebRoot/component/images/zTree/line_conn.gif | Bin 0 -> 45 bytes WebRoot/view/tb/dis/publish.html | 13 +- WebRoot/view/tb/dis/publish_person.html | 174 +++++++++++++++---- 3 files changed, 146 insertions(+), 41 deletions(-) create mode 100644 WebRoot/component/images/zTree/line_conn.gif diff --git a/WebRoot/component/images/zTree/line_conn.gif b/WebRoot/component/images/zTree/line_conn.gif new file mode 100644 index 0000000000000000000000000000000000000000..d561d36a915776730eb3069cee4c949f027667ed GIT binary patch literal 45 xcmZ?wbhEHb
-
+
@@ -106,7 +106,7 @@
+ style="border-style:dashed;border-width:1px;border-color: #CCCCCC;height: 100px;width: 714px;padding: 10px;overflow: auto;">
@@ -116,25 +116,29 @@
-
-
+
+
+ style="border: 1px solid #EEEEEE;height: 375px;">
-
+ style="min-height: 38px !important;width: 580px;"> +
+ style="cursor: pointer;" lay-on="search">
+
@@ -147,7 +151,14 @@
- 4 +
+
+ +
@@ -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");