new Vue({
	el: "#app",
	data: {
	},
	mounted: function() {
	},
	methods: {
		

	}
});
$.validator.setDefaults({
	highlight: function(e) {
		$(e).closest(".form-group").removeClass("has-success").addClass("has-error")
	},
	success: function(e) {
		e.closest(".form-group").removeClass("has-error").addClass("has-success")
	},
	errorElement: "span",
	errorPlacement: function(e, r) {
		e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
	},
	errorClass: "help-block m-b-none",
	validClass: "help-block m-b-none"
}), $().ready(function() {
	var e = "<i class='fa fa-times-circle'></i> ";
	$("#newInterfaceForm").validate({
		rules: {
			realName: {
				required: !0,
				noNull: !0,
			}, 
			micard: {
				required: !0,
				noNull: !0,
				validSSC:!0,
			},
			ssid: {
				required: !0,
				noNull: !0,
				validNumWord:!0,
			}, 
			idCardNo: {
				required: !0,
				noNull: !0,
				isCardNo:!0,
			},
			telephone: {
				required: !0,
				noNull: !0,
			}, 
			profession: {
				required: !0,
				noNull: !0,
			},
			street:{
				required: !0,
				noNull: !0,
			}
		},
		messages: {
			realName: {
				required: e + "请输入姓名",
			}, 
			micard: {
				required: e + "请输入医保账号",
			}, 
			ssid: {
				required: e + "请输入社保账号",
			},
			idCardNo: {
				required: e + "请输入身份证号",
			},
			telephone: {
				required: e + "请输入手机号码",
			}, 
			profession: {
				required: e + "请输入行业",
			},  
			street: {
				required: e + "请输入街道地址",
			}, 
		}
	})
});
jQuery.validator.addMethod("noNull", function(value, element) {	
	var aaa=isNull(value)
	var bbb=this.optional(element)
	return this.optional(element) || !isNull(value)
}, "此项必填，不得为空！");
jQuery.validator.addMethod("isCardNo", function(value, element) {
	var reg =/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
	var aaa=reg.test(value)
	var bbb=this.optional(element)
	return this.optional(element) || reg.test(value);
}, "请输入有效的身份证！");
jQuery.validator.addMethod("validSSC", function(value, element) {
	var reg =/^([a-zA-Z]{1}[a-zA-Z0-9]{8}|[0-9]{12})$/
	return this.optional(element) || reg.test(value);
}, "请填写有效的医保卡卡号！");
jQuery.validator.addMethod("validNumWord", function(value, element) {
	var reg =/^[0-9a-zA-Z]+$/
	return this.optional(element) || reg.test(value);
}, "请填写有效的社保卡号！");