contactsAdd.js 1.3 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

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$;
	    
	    matchingLanguage();
 		form.render();
 	    form.on('submit(formAddBean)', function (data) {
 	        if (winui.verifyForm(data.elem)) {
 	        	var params = {
doc_wei's avatar
doc_wei 已提交
18 19 20
					objectId: parent.objectId,
					objectKey: parent.objectKey,
 	        		name: $("#name").val(),
doc_wei's avatar
doc_wei 已提交
21 22 23 24 25 26 27 28 29
 	        		department: $("#department").val(),
 	        		job: $("#job").val(),
 	        		workPhone: $("#workPhone").val(),
 	        		mobilePhone: $("#mobilePhone").val(),
 	        		email: $("#email").val(),
 	        		qq: $("#qq").val(),
 	        		wechat: $("#wechat").val(),
 	        		isDefault: $("input[name='isDefault']:checked").val()
 	        	};
doc_wei's avatar
doc_wei 已提交
30
 	        	AjaxPostUtil.request({url: reqBasePath + "writeContactsMation", params: params, type: 'json', method: 'POST', callback: function (json) {
31 32
					parent.layer.close(index);
					parent.refreshCode = '0';
doc_wei's avatar
doc_wei 已提交
33 34 35 36 37
	 	   		}});
 	        }
 	        return false;
 	    });
 	    
doc_wei's avatar
doc_wei 已提交
38
	    $("body").on("click", "#cancle", function() {
doc_wei's avatar
doc_wei 已提交
39 40 41 42
	    	parent.layer.close(index);
	    });
	});
});