| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- $(function () {
- $("#form-landApply-edit").validate({
- rules: {
- "companyInfo.industry_code" :{
- required : true
- },
- "companyInfo.registration_address" :{
- required : true
- },
- "companyInfo.contact" :{
- required : true
- },
- "companyInfo.contact_phone" :{
- required : true,
- isTel : true
- }
- },
- messages: {
-
- },
- onkeyup: false,
- focusCleanup: true,
- success: "valid"
- /*submitHandler: function (form) {
- // $(form).find(":submit").attr("disabled", true);
- if(!($("#isDraft").val()==1)){
- var validateFile = true;
- $("#applyMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有基准材料!');
- validateFile = false;
- }
- });
- if(validateFile){
- if($("#summaryProcedureType").find("input:checked").length>0){
- //简易程序材料必填
- $("#summaryMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有简易程序相关材料!');
- validateFile = false;
- }
- });
- }
- }
- if(validateFile){
- if($("#otherMaterials").find(".td_material").length>1){
- //已经添加材料,不能有空行
- $("#otherMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有其他材料!');
- validateFile = false;
- }
- });
- }
- }
- if(!validateFile){
- return false;
- }
- }
- setDocName();
- $("#deleteMaterialIds").val(deleteMaterialIds);
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath + "/stockLand/applySave",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }*/
- });
-
- });
- //添加文件
- function addFile(title,url,w,h,obj){
- var fileName = $(obj).val();
- if(fileName!=""){
- errorMessage('请先点击右侧按钮删除文件,再重新添加!');
- }else{
- layer_show(title,pagePath+url,w,h);
- }
- }
- function changeType(obj){
- var type = $(obj).val();
- var url = pagePath+"/stockLand/add/"+type;
- location.replace(url);
- }
- //添加相应name的文件
- function addFileByName(url,obj){
- var name = $(obj).next().attr("name");
- url += "?fileIdName="+name;
- layer_show('添加文件',pagePath+url,800,350);
- }
- function saveDraft(isSaveDraft) {
- $("#isDraft").val(isSaveDraft);
- // $(form).find(":submit").attr("disabled", true);
- if(!($("#isDraft").val()==1)){
- if(!$("#form-landApply-edit").valid()){
- return false;
- }
- var validateFile = true;
- $("#applyMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有基准材料!');
- validateFile = false;
- }
- });
- if(validateFile){
- if($("#summaryProcedureType").find("input:checked").length>0){
- //简易程序材料必填
- $("#summaryMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有简易程序相关材料!');
- validateFile = false;
- }
- });
- }
- }
- if(validateFile){
- if($("#otherMaterials").find(".td_material").length>1){
- //已经添加材料,不能有空行
- $("#otherMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有其他材料!');
- validateFile = false;
- }
- });
- }
- }
- if(!validateFile){
- return false;
- }
- }
- setDocName();
- $("#deleteMaterialIds").val(deleteMaterialIds);
- $("#form-landApply-edit").ajaxSubmit({
- type: 'post',
- url: pagePath + "/stockLand/applySave",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- //弹出框
- function open_dialog(title, url, w, h) {
- var index = layer_show(title, pagePath + url, w, h);
- layer.full(index);
- }
|