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.

133 lines
5.1 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;
}
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" style="margin-bottom: 10px !important;">
<label class="layui-form-label" style="width: auto !important;"></label>
</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 style="position: absolute;top: 55px;left: 49px;">
表单
</span>
</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="EXCEL" style="width: 50px;margin-left: -22px;" id="excel">
<span style="position: absolute;top: 55px;left: 156px;">
Excel
</span>
</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();
}
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>