main
kgdxpr 2 years ago
parent 009dd930c7
commit 5c4b2bca01

@ -81,7 +81,8 @@
data: {
"job_name": $("#task_name").val(),
"table_name": "ds_" + $("#table_name").val(),
"json": window.localStorage.getItem('form_json')
"json": window.localStorage.getItem('form_json'),
"target_type_id": window.localStorage.getItem('target_type_id')
},
success: function (result) {
if (result.success) {

@ -37,33 +37,41 @@
</style>
</head>
<body class="pear-container layui-form">
<div class="content">
<table>
<colgroup>
<col width="350">
<col width="100">
<col width="350">
</colgroup>
<tbody>
<tr>
<td><img src="../imgs/form.png" alt="" style="width: 60%;height: 60%;" lay-on="form"></td>
<td></td>
<td><img src="../imgs/excel.png" alt="" style="width: 55%;height: 55%;" lay-on="excel"></td>
</tr>
<tr>
<td><span lay-on="form">表单</span></td>
<td></td>
<td><span lay-on="excel">EXCEL模板</span></td>
</tr>
</tbody>
</table>
<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>
@ -72,9 +80,61 @@
<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 () {

@ -90,6 +90,16 @@
{{# } }}
</script>
<script type="text/html" id="targetType">
{{#if (d.target_type_id == 1) { }}
机构单位
{{# } else { }}
群体 / 具体人
{{# } }}
</script>
<script type="text/html" id="jobName-Templet">
{{#if (d.job_type == 1) { }}
<img src="../imgs/form.png" title="表单" style="max-width: 16px;margin-top: -4px;">
@ -200,9 +210,9 @@
{ title: '任务名称', unresize: true, align: 'left', templet: '#jobName-Templet' },
{ title: '发布时间', unresize: true, field: 'publish_time', align: 'center', width: "6%" },
{ title: '截止时间', unresize: true, field: 'deadline_time', align: 'center', width: "6%" },
{ title: '填报格式', unresize: true, field: 'job_type_name', align: 'center', width: "8%" },
{ title: '填报进度', unresize: true, align: 'center', width: "6%", templet: '#fill-progress' },
{ title: '转发进度', unresize: true, align: 'center', width: "6%", templet: '#forward-progress' },
{ title: '发布对象', unresize: true, align: 'center', width: "8%" , templet: '#targetType'},
{ title: '保存状态', unresize: true, field: 'is_save_name', align: 'center', width: "6%" },
{ title: '发布状态', unresize: true, field: 'publish_state_name', align: 'center', width: "6%" },
{ title: '操作', unresize: true, align: 'left', width: "20%", toolbar: '#table-bar' }
@ -396,9 +406,9 @@
window.createTask = function () {
layer.open({
type: 2,
title: '选择填报格式',
title: '创建任务',
shade: 0.1,
area: ['450px', '250px'],
area: ['450px', '260px'],
content: './format_select.html'
});
}

Loading…
Cancel
Save