// 归档弹框js
guiDangRemarkInfo : function(activiti, buttonConf, call) {
layui.use(['layer', 'form', 'laydate'], function () {
var layer = layui.layer;
var form = layui.form;
var laydate = layui.laydate;
layer.open({
type: 1,
title: '归档备注信息',
area: ['350px', '300px'],
content: getModalContent(),
success: function () {
// 初始化表单
form.render();
// 初始化时间选择器
laydate.render({
elem: '#time'
});
// 监听表单提交
form.on('submit(submitForm)', function (data) {
// 获取表单数据
var formData = data.field;
var url="xxxxxxxxx/saveGuiDangRemarks";
$.post(url, {storyId:currentStoryId,guiDangPublishedDate:formData.guiDangPublishedDate, guiDangAuditleader:formData.guiDangAuditleader},
function (res){
if (res.code==200){
call({code:1,log:data.msg});
}else {
call({code:-1,log:"归档备注信息表单提交失败"})
}
},"json");
// 关闭弹窗
layer.closeAll();
return false; // 阻止表单默认提交
});
// 取消按钮点击事件
document.getElementById('cancelBtn').onclick = function () {
layer.closeAll();
};
}
});
// 构建弹窗的内容
function getModalContent() {
var html = '<form class="layui-form" id="myForm" lay-filter="myForm">';
html += '<div class="layui-form-item">';
html += '<label class="layui-form-label" style="color:red;font-size:14px;width:320px">注意:归档功能仅限已发布但重复提交的稿件</label>';
html += '</div>';
html += '<div class="layui-form-item">';
html += '<label class="layui-form-label" style="width:100px"><span style="color:red;font-size:10px">*</span>发布时间</label>';
html += '<div class="layui-input-block">';
html += '<input type="text" style="width:180px" name="guiDangPublishedDate" id="time" class="layui-input" lay-verify="required" placeholder="请选择发布时间">';
html += '</div>';
html += '</div>';
html += '<div class="layui-form-item">';
html += '<label class="layui-form-label" style="width:100px"><span style="color:red;font-size:10px">*</span>审核领导</label>';
html += '<div class="layui-input-block">';
html += '<input type="text" name="guiDangAuditleader" style="width:180px" class="layui-input" lay-verify="required" placeholder="请输入审核领导">';
html += '</div>';
html += '</div>';
html += '<div class="layui-form-item">';
html += '<div class="layui-input-block">';
html += '<button class="layui-btn" lay-submit lay-filter="submitForm">确定</button>';
html += '<button type="button" id="cancelBtn" class="layui-btn layui-btn-primary">取消</button>';
html += '</div>';
html += '</div>';
html += '</form>';
return html;
}
});
}