sysnoticetimeup.js 1.5 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

var typeId = "";
var secondTypeId = "";
var layedit;

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'tableSelect', 'laydate'], function (exports) {
	winui.renderColor();
	layui.use(['form', 'layedit'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$,
	    form = layui.form,
	    tableSelect = layui.tableSelect,
    	laydate = layui.laydate;
	    layedit = layui.layedit;
	
 		//定时通知时间选择器
 		laydate.render({
 		  elem: '#delayedTime'
 		  ,type: 'datetime'
 		});
 	
 		matchingLanguage();
 		form.render();
 	    form.on('submit(formAddBean)', function (data) {
 	        if (winui.verifyForm(data.elem)) {
 	        	var params = {
 	        		rowId: parent.rowId,
 	        		title: parent.title,
 	        		delayedTime: $("#delayedTime").val()
 	        	};
        		if(isNull(params.delayedTime)){
        			winui.window.msg('请选择定时通知时间', {icon: 2,time: 2000});
 	        		return false;
        		}
doc_wei's avatar
doc_wei 已提交
40
    			AjaxPostUtil.request({url:reqBasePath + "notice011", params:params, type: 'json', callback: function(json){
doc_wei's avatar
doc_wei 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    				if(json.returnCode == 0){
    					parent.layer.close(index);
    	 	        	parent.refreshCode = '0';
    				}else{
    					winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
    				}
    			}});
 	        }
 	        return false;
 	    });
 	    
	    $("body").on("click", "#cancle", function(){
	    	parent.layer.close(index);
	    });
	});
});