/**
 *
 * @author BOGON
 * @version 1.0
 */

var page = {
    submitFlag: 0,
    save: function (call) {
        if (page.submitFlag == 1) {
            return;
        }
        if (!$('#form').form("validate")) {
            return;
        }
        var formData = $("#form").serializeJson();
        var idAry = ids.split(",");
        var formArray = [];
        $.each(idAry, function (idx, itm) {
            formArray.push({
                id: itm,
                markDate: formData.markDate,
                markType: formData.markType,
                markCount: formData.markCount
            })
        });
        page.submitFlag = 1;
        $.ajax({
            type: "POST", //请求方式
            contentType: "application/json",
            data: JSON.stringify(formArray),
            url: g.ctx + "pc/order/purchaseOrderMark/rest/updateBatch", //请求路径
            success: function (data) {
                page.submitFlag = 0;
                topWin.layer.alert("修改成功", function (idx) {
                    topWin.layer.close(idx)
                    call();
                })
            },
            error: function (data) {
                page.submitFlag = 0;
                topWin.layer.alert(data.responseJSON.message);
            }
        });
    }
}
$(function () {
})