美文网首页
ajax带对象提交

ajax带对象提交

作者: 吹破天 | 来源:发表于2018-10-14 20:18 被阅读0次

    //卖船要求信息

                var sellerVesselInfo = {

    "vesselName": vesselName,

    "registry": registry,

    "vesselTexture": vesselTexture,

    "jobType": jobType,

    "grossTon": grossTon,

    "netTon": netTon,

    "loa": loa,

    "beam": beam,

    "vesselDepth": vesselDepth,

    "enginType": enginType,

    "engine": engine,

    "yard": yard,

    "vesselExplain": vesselExplain,

    "stringBuilt":$("#built1").val(),

    "projectCode": projectCode

    };

    //卖家信息

                var sellerInfo = {

    "owner": owner,

    "ownerCode": ownerCode,

    "address": address,

    "ownerTel": ownerTel,

    "saleRequirement": saleRequirement,

    "vesselOwnerType":"true",

    "projectCode": projectCode

    };

    //船舶所有人所占比例

    //            var sellerStockPercent = {

    //                "owner": $("#people").val(),

    //                "pencent": $("#percent").val(),

    //                "projectCode": $("#project_code").html()

    //            };

                var para = {

    "id": $("#ID").html(),

    "projectCode": projectCode,

    "projectName": projectName,

    "assessmentPrice": assessmentPrice,

    "listingPrice": listingPrice,

    "stringListingStart":$("#listing_start_date").val(),

    "stringListingEnd":$("#listing_end_date").val(),

    "contactsPerson": contactsPerson,

    "contactsOfficeTel": contactsOfficeTel,

    "contactsTel": contactsTel,

    "contactsFax": contactsFax,

    "status":status,

    "sellerVesselInfo": sellerVesselInfo,

    "sellerInfo": sellerInfo,

    "sellerStockPercent": getValue()

    };

    console.info(JSON.stringify(para));

    $.ajax({

    type:"POST",

    url:"/saleApplication/saveApplication",

    contentType:'application/json;charset=UTF-8',

    data: JSON.stringify(para),

    dataType:"json",

    success:function (data) {

    console.log(data);

    console.log(data.success);

    if (data.success) {

    //设置保存按钮有效

                            $("#save").attr("disabled",false);

    sweetAlert('操作成功');

    window.location.href ='/saleApplication';

    }else {

    //设置保存按钮有效

                            $("#save").attr("disabled",false);

    sweetAlert('未知错误');

    //window.location.href = '/saleApplication';

                        }

    }

    });

    }

    相关文章

      网友评论

          本文标题:ajax带对象提交

          本文链接:https://www.haomeiwen.com/subject/hkutzftx.html