var el = {
    form : '#form',
    useState: '#useState',
    attachment: '#attachment',
}
$(function () {
    //加载考核维度数据
    $('#dimensionCode').combobox({
        valueField: 'dimensionCode',
        textField: 'dimensionName',
        url: g.ctx + 'pc/spe/supAppraiseDimension/rest/listAll',
        editable: false,
        prompt: '--- 请选择 ---',
        panelHeight: 150,
        panelWidth: 300,
        onSelect:function (data) {
            $('#dimensionName').val(data.dimensionName);
        }
    });
});
function saveOrUpdate(call) {
    if($(el.form).form('validate')){
        var formData = $(el.form).serializeJson();
        var loading = topWin.layer.msg('处理中', {icon: 16, shade: [0.1, '#000'], time: false});
        $.ajax({
            url: g.ctx + 'pc/spe/supAppraiseQuota/rest/saveOrUpdate',
            method: 'post',
            data: formData,
            success: function (data) {
                topWin.layer.msg('操作成功', {icon: 1});
                call();
            },
            complete: function(data) {
                topWin.layer.close(loading);
            },
            error: function (data) {
                topWin.layer.alert(data.responseJSON.message, {icon: 2});
            }
        });
    }else{
        layer.msg("红色框为必输项，请填写！");
    }
}