/**
 *
 * @author BOGON
 * @version 1.0
 */
var page = {
    roundId: 0,
    bondId: 0,
    preCheckId: 0,
    update: function (call) {
        const serializeJson = $("#formData").serializeJson();

        const round = {}
        const securityDeposit = {}
        $.each(serializeJson, function (idx, itm) {
            if (idx.indexOf('round.') != -1) {
                round[idx.replace('round.', '')] = itm
            } else {
                securityDeposit[idx.replace('securityDeposit.', '')] = itm
            }
        })
        const postData = {
            round: round,
            securityDeposit: securityDeposit
        }
        $.ajax({
            url: g.ctx + "pc/tender/rest/updateTime",
            type: "POST",
            contentType: 'application/json',
            data: JSON.stringify(postData),
            success: function () {
                topWin.layer.alert("操作成功", {
                    icon: 1,
                    closeBtn: 0,
                    yes: function (index) {
                        topWin.layer.close(index);
                        call();
                    }
                });
            }, error: function (data) {
                topWin.layer.alert(data.responseJSON.message, {icon: 2});
            }
        })
    }
}
