/*
 * The Hefei Ceshi RDC(Research and Development Centre) Group.
 * __________________
 *
 *    Copyright 2015-2019
 *    All Rights Reserved.
 *
 *    NOTICE:  All information contained herein is, and remains
 *    the property of Ceshi Company and its suppliers,
 *    if any.
 */

/**
 *
 * @author BOGON
 * @version 1.0
 */
var page = {
    loadBond: function () {
        $.ajax({
            url: g.ctx + "pc/tender/bid/rest/getDetail",
            type: 'GET',
            data: {id: bidId},
            success: function (d) {
                $("#form").form("load", d.securityDeposit)
                // 设置所有 NumberBox 为只读模式
                $('.easyui-numberbox').numberbox('readonly', true);
                // 设置所有 TextBox 为只读模式
                $('.easyui-textbox').textbox('readonly', true);
                // 设置所有 ComboBox 为只读模式
                $('.easyui-combobox').combobox('readonly', true);
            }
        });
    },
    fileUpload: function (bidId, call) {
        var url = g.ctx + 'pc/tender/bid/rest/submitDeposit';
        $.ajax({
            url: url,
            method: "post",
            data: {id: bidId, fileId: $("#fileId").val()},
            success: function (data) {
                topWin.layer.alert("提交成功", {icon: 1}, function (idx) {
                    call();
                    topWin.layer.close(idx);
                });
            }, error: function (data) {
                topWin.layer.alert(data.responseJSON.message, {icon: 2});
            }
        });
    }
};
$(function () {
    page.loadBond();
    singleFileUpload("fileName", "fileId");
});