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.

156 lines
5.7 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
<style>
.content {
width: 300px;
height: 140px;
/* border: 1px solid red; */
position: absolute;
top: 45%;
left: 50%;
border-radius: 12px;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
display: flex;
justify-content: space-between;
}
td {
text-align: center;
}
span {
cursor: pointer;
font-weight: bolder;
}
td img {
cursor: pointer;
}
</style>
</head>
<body class="pear-container">
<form class="layui-form" action="">
<div class="mainBox">
<div class="main-container" style="margin-top: 25px;">
<div class="layui-form-item">
<label class="layui-form-label" style="width: auto !important;">发布对象:</label>
<div class="layui-input-block" style="margin-left: 90px !important;">
<input type="radio" name="targetId" value=1 title="机构单位" checked lay-filter="targetId">
<input type="radio" name="targetId" value=2 title="群体 / 具体人" lay-filter="targetId">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: auto !important;">任务格式:</label>
<div class="layui-input-block" style="margin-left: 90px !important;">
<span style="font-weight:normal" id="form_radio">
<input type="radio" name="formType" value="1" checked><img src="../imgs/form.png" title="表单"
style="width: 50px;margin-left: -22px;margin-right: 29px;">
</span>
<span style="font-weight:normal" id="excel_radio">
<input type="radio" name="formType" value="2" style="margin-left: 130px;"><img
src="../imgs/excel.png" title="表格" style="width: 50px;margin-left: -22px;" id="excel">
</span>
</div>
</div>
</div>
</div>
<div class="bottom">
<div class="button-container">
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="save">
<i class="layui-icon layui-icon-ok"></i>
确定
</button>
</div>
</div>
</form>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
<script>
layui.use(function () {
var form = layui.form;
var $ = layui.jquery;
var util = layui.util;
localStorage.removeItem('target_type_id');
form.on('radio(targetId)', function (data) {
if (data.value == 2) {
$('#excel_radio').hide();
$('input[name="formType"][value="1"]').prop('checked', true);
layui.form.render('radio');
} else {
$('#excel_radio').show();
}
});
form.on('submit(save)', function (data) {
parent.layer.close(parent.layer.getFrameIndex(window.name));
window.localStorage.setItem('target_type_id', parseInt(data.field.targetId));
if (data.field.formType == "1") {
parent.openFormCreatePage();
} else {
parent.openExcelCreatePage();
}
// $.ajax({
// url: '/QingLong/collect/cloneJob',
// type: 'post',
// data: {
// "job_id": jobId,
// "job_name": $("#task_name").val()
// },
// 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;
});
util.on({
form: function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
parent.openFormCreatePage();
},
excel: function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
parent.openExcelCreatePage();
}
});
});
</script>
</body>
</html>