parent
14f6d66422
commit
472aee8dd0
@ -0,0 +1,306 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
||||
<style>
|
||||
.require-star {
|
||||
position: absolute;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background-color: #ea4335;
|
||||
top: 12px;
|
||||
right: 8px;
|
||||
border-radius: 1.5px;
|
||||
}
|
||||
|
||||
.input-width {
|
||||
max-width: 470px
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
|
||||
<fieldset class="layui-elem-field" style="background-color: #E6F7F6;margin: 10px 20px 10px 20px;">
|
||||
<div class="layui-field-box" style="padding: 5px 15px 1px 15px !important;">
|
||||
<label class="layui-form-label"
|
||||
style="width: auto !important;font-weight: bolder;padding: 1px !important;color: #16BAAA;"></span>上级任务要求</label>
|
||||
<div class="layui-form-item" style="margin-bottom: 1px !important;">
|
||||
<label class="layui-form-label"
|
||||
style="width: auto !important;font-weight: bolder;"></span>填报要求:</label>
|
||||
<div class="layui-input-block" style="margin-left: 90px !important;padding-top: 9px;"
|
||||
id="sjtbyq">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom: 1px !important;margin-top: -8px !important;">
|
||||
<label class="layui-form-label"
|
||||
style="width: auto !important;font-weight: bolder;"></span>截止时间:</label>
|
||||
<div class="layui-input-block" style="margin-left: 90px !important;padding-top: 9px;"
|
||||
id="sjjzrq">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom: 1px !important;margin-top: -8px !important;">
|
||||
<label class="layui-form-label"
|
||||
style="width: auto !important;font-weight: bolder;"></span>发布对象:</label>
|
||||
<div class="layui-input-block" style="margin-left: 90px !important;padding-top: 9px;" id="fbdx">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div class="main-container" style="margin-top: 20px;margin-bottom: 0;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 100px !important;"></span>本级填报要求:</label>
|
||||
<div class="layui-input-block" style="margin-left: 90px !important;">
|
||||
<textarea name="memo" placeholder="请输入填报要求" class="layui-textarea input-width"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: 100px !important;"><span
|
||||
class="require-star"></span>本级截止日期:</label>
|
||||
<div class="layui-input-block" style="margin-left: 90px !important;">
|
||||
<input type="text" class="layui-input input-width" lay-verify="required" name="deadline_time"
|
||||
id="endDate" placeholder="请选择截止日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-bottom: 0 !important;">
|
||||
<label class="layui-form-label" style="width: 100px !important;"><span
|
||||
class="require-star"></span>选择范围:</label>
|
||||
<div class="layui-input-block" style="margin-left: 134px !important;">
|
||||
<div class="layui-tab layui-tab-brief">
|
||||
<ul class="layui-tab-title" style="border-bottom-style:none">
|
||||
<li class="layui-this">快捷选择</li>
|
||||
<li>按教师选择</li>
|
||||
<span id="class_select" hidden>
|
||||
<li>按班级选择</li>
|
||||
</span>
|
||||
<li>按指定分组选</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
|
||||
<div class="layui-tab-item layui-show">
|
||||
<span>
|
||||
<input type="checkbox" id="syjs" lay-skin="tag" title="所有教师" class="kj1">
|
||||
</span>
|
||||
<span id="stu_all" hidden>
|
||||
<input type="checkbox" id="syxx" lay-skin="tag" title="所有学生" class="kj1">
|
||||
</span>
|
||||
<div id="njView" style="margin-top: 10px;">
|
||||
</div>
|
||||
<script id="njScript" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<input type="checkbox" id="{{item.nj_id}}" lay-skin="tag" title="{{item.nj_name}}" class="kj2">
|
||||
{{# }); }}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-tab-item">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<div class="button-container" style="left: 15px !important">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="publish">
|
||||
<i class="layui-icon layui-icon-release"></i>
|
||||
发布
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script src="../../../component/layui/layui.js"></script>
|
||||
<script src="../../../component/pear/pear.js"></script>
|
||||
<script>
|
||||
layui.use(['tag'], function () {
|
||||
var form = layui.form;
|
||||
var $ = layui.jquery;
|
||||
var laydate = layui.laydate;
|
||||
var tab = layui.tab;
|
||||
var util = layui.util;
|
||||
var tag = layui.tag;
|
||||
var table = layui.table;
|
||||
var laytpl = layui.laytpl;
|
||||
|
||||
var personIds = [];
|
||||
var classIds = [];
|
||||
var publishData = {}
|
||||
|
||||
|
||||
var jobId = GetQueryString("job_id");
|
||||
|
||||
$.ajax({
|
||||
url: "/QingLong/collect/getJob?job_id=" + jobId,
|
||||
async: false,
|
||||
type: 'GET',
|
||||
success: function (res) {
|
||||
$("#sjtbyq").html(res.memo);
|
||||
var sjjzrq = res.deadline_time.split(" ")[0];
|
||||
$("#sjjzrq").html(sjjzrq);
|
||||
if (res.target_type_id == 1) {
|
||||
$("#fbdx").html("机构单位 ");
|
||||
} else {
|
||||
$("#fbdx").html("具体人");
|
||||
}
|
||||
|
||||
laydate.render({
|
||||
elem: '#endDate',
|
||||
max: sjjzrq,
|
||||
min: 0
|
||||
});
|
||||
|
||||
}, error: function (xhr, status, error) {
|
||||
layer.msg("获取数据异常!", {
|
||||
icon: 2,
|
||||
time: 1000
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//学部
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
async: false,
|
||||
url: "/QingLong/collect/getSchoolNjList",
|
||||
success: function (res) {
|
||||
if (res.data.length > 0) {
|
||||
$("#class_select").show();
|
||||
$("#stu_all").show();
|
||||
var njTpl = njScript.innerHTML;
|
||||
var njView = document.getElementById('njView');
|
||||
laytpl(njTpl).render(res.data, function (html) {
|
||||
njView.innerHTML = html;
|
||||
});
|
||||
form.render();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
form.on('submit(publish)', function (data) {
|
||||
|
||||
var allTeacher = 0;
|
||||
var allStudent = 0;
|
||||
|
||||
$('input[type="checkbox"][class="kj1"]').each(function () {
|
||||
var isChecked = $(this).prop('checked');
|
||||
var checkboxText = $(this).attr('id');
|
||||
if (isChecked) {
|
||||
if (checkboxText == 'syjs') {
|
||||
allTeacher = 1;
|
||||
} else if (checkboxText == 'syxx') {
|
||||
allStudent = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var njCheckedIds = Array.from(document.querySelectorAll('.kj2:checked')).map(function (checkbox) {
|
||||
return checkbox.id;
|
||||
});
|
||||
|
||||
|
||||
publishData.job_id = jobId;
|
||||
publishData.allTeacher = allTeacher;
|
||||
publishData.allSutdent = allStudent;
|
||||
publishData.njIds = njCheckedIds.join(",");
|
||||
publishData.personIds = personIds.join(",");
|
||||
publishData.classIds = classIds.join(",");
|
||||
publishData.deadline_time = data.field.deadline_time;
|
||||
publishData.memo = data.field.memo;
|
||||
|
||||
console.log(publishData);
|
||||
|
||||
$.ajax({
|
||||
url: '/QingLong/collect/ForwardJob',
|
||||
type: 'post',
|
||||
data: publishData,
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg("发布成功!", {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
parent.refresh();
|
||||
});
|
||||
} else {
|
||||
layer.msg(result.message, {
|
||||
icon: 2,
|
||||
time: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
window.publish_save = function (param) {
|
||||
publishData.fill_type_id = param;
|
||||
$.ajax({
|
||||
url: '/QingLong/collect/publishJob',
|
||||
type: 'post',
|
||||
data: publishData,
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg("发布成功!", {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
parent.refresh();
|
||||
});
|
||||
} else {
|
||||
layer.msg(result.message, {
|
||||
icon: 2,
|
||||
time: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function GetQueryString(name, istop) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
||||
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in new issue