| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- $(function () {
- $("#form-companyReport-add").validate({
- rules: {
- report_year: {
- required: true,
- remote: {
- url: pagePath+"/government/companyReport/isExistReportMonth",
- type: "get",
- data: {
- report_year: function () {
- return $("#report_year").val();
- },
- report_month: function () {
- return $("#report_month").val();
- },
- timestamp: new Date().getTime()
- }
- }
- },
- report_month:{
- required: true,
- remote: {
- url: pagePath+"/government/companyReport/isExistReportMonth",
- type: "get",
- data: {
- report_year: function () {
- return $("#report_year").val();
- },
- report_month: function () {
- return $("#report_month").val();
- },
- timestamp: new Date().getTime()
- }
- }
- },
- revenue: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- cost: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- account: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- taxs: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- employees: {
- required: true,
- isInteger:true,
- maxlength:12
- },
- profits: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- electricity: {
- isFloat2:true,
- required: true,
- maxlength:12
- },
- wages: {
- isFloat4:true,
- required: true,
- maxlength:12
- },
- assets: {
- isFloat4:true,
- required: true,
- maxlength:12
- },
- debt: {
- isFloat4:true,
- required: true,
- maxlength:12
- }
- },
-
- messages: {
- report_year: {
- remote: "该月份数据已经上报!"
- },
- report_month: {
- remote: "该月份数据已经上报!"
- }
- },
- onkeyup: false,
- focusCleanup: true,
- success: "valid",
- submitHandler: function (form) {
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath+"/government/companyReport/save",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- errorMessage(data.message);
- }
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- });
- });
|