| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- $(function () {
- $("#form-projectApplication-edit").validate({
- rules: {
- "companyInfo.company_name": {
- required: true
- },
- "companyInfo.industry_code": {
- required: true
- },
- "companyInfo.registration_address": {
- required: true
- },
- "companyInfo.currency_unit": {
- required: true
- },
- "companyInfo.registration_capital": {
- required: true,
- min: 0,
- max: 999999999.9999,
- isFloat: true,
- isFloat4Fn: true
- },
- "companyInfo.legal_representative": {
- required: true
- },
- "companyInfo.contact": {
- required: true
- },
- "companyInfo.lr_position": {
- required: true
- },
- "companyInfo.contact_position": {
- required: true
- },
- "companyInfo.lr_phone": {
- required: true,
- isTel: true
- },
- "companyInfo.contact_phone": {
- required: true,
- isTel: true
- },
- "companyInfo.total_assets_currency_unit": {
- required: true
- },
- "companyInfo.total_assets": {
- required: true,
- min: 0,
- max: 999999999.999999,
- isFloat: true,
- isFloat6Fn: true
- },
- "companyInfo.fixed_assets_currency_unit": {
- required: true
- },
- "companyInfo.fixed_assets": {
- required: true,
- min: 0,
- max: 999999999.999999,
- isFloat: true,
- isFloat6Fn: true
- },
- "project_type": {
- required: true
- },
- "customize_name": {
- required: true
- }
- },
- messages: {},
- onkeyup: false,
- focusCleanup: true,
- success: "valid"
- });
- });
- function submit() {
- if (!($("#isDraft").val() == 1)) {
- if ($("#form-projectApplication-edit").valid()) {
- var valid = true;
- $("#applyMaterials").find(".uploadFileName").each(function(){
- if($(this).val()==""){
- errorMessage('请上传所有申报材料!');
- valid = false;
- }
- });
- if (!$("#isStatement").is(":checked")) {
- errorMessage('请勾选企业声明!');
- valid = false;
- }
- if (!valid) {
- return false;
- }
- } else {
- return false;
- }
- } else {
- //保存草稿
- var validateBaseInfo = true;
- if ($("#project_type").val() == "" || $("#project_id").val() == "") {
- errorMessage('请选择项目!');
- validateBaseInfo = false;
- }
- if (!validateBaseInfo) {
- return false;
- }
- }
- //提交
- $("#form-projectApplication-edit").ajaxSubmit({
- type: 'post',
- url: pagePath + "/projectApplication/save",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- layer.open({
- title: '提示!'
- , content: data.message
- , btn: ['确定']
- , yes: function (index, layero) {
- layer.close(index);
- var index = parent.layer.getFrameIndex(window.name);
- if (index) {
- parent.location.reload();
- parent.layer.close(index);
- } else {
- // window.location.href = pagePath + "/home/informList/69";
- history.back(-2);
- }
- }
- , cancel: function () {
- var index = parent.layer.getFrameIndex(window.name);
- if (index) {
- parent.location.reload();
- parent.layer.close(index);
- } else {
- // window.location.href = pagePath + "/home/informList/69";
- history.back(-2);
- }
- return true;
- }
- });
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false;
- }
- //弹出框
- function open_dialog(title, url, w, h) {
- layer_show(title, pagePath + url, w, h);
- }
- //添加文件
- function addFile(title, url, w, h) {
- layer_show(title, pagePath + url, w, h);
- }
- //添加相应name的文件
- function addFileByName(url, obj) {
- var name = $(obj).next().attr("name");
- url += "?fileIdName=" + name;
- layer_show('添加文件', pagePath + url, 800, 350);
- }
|