1.html代码:

科目名称:

        

账户名称:

        

2.js代码

/* 动态加载账户名称 */
function getAccountnameList(){
     //获取下拉列表的选项值
     var id = $("#accountitem").combobox("getValue");  
     $('#accountname').combobox({
                url: '${ctx}/oa/fdr/accountnameList?id='+id,
                valueField: 'id',        //id是返回json字符串中的key,对应下拉列表值
                textField: 'name',     //name是返回json字符串中的key,对应下拉列表显示文本
                onLoadSuccess : function(record){
                        //默认选中第一项
                        $('#accountname').combobox('setValue',record[0].id); 
                 }
        });
        getCapitalsummary();
};
//json数据如下:
[{"group":"","id":"cwzhnhfsy","name":"农行","selected":true},
{"group":"","id":"cwzhnhpos","name":"工行","selected":false},
{"group":"","id":"cwzhjhlzl","name":"建行","selected":false},
{"group":"","id":"cwzhjnpos","name":"POS机","selected":false}]

/* 动态加载期初余额 */
function getCapitalsummary(){
        var accountname = $("#accountname").combobox("getValue");
        $.post('${ctx}/oa/fdr/capitalsummary',{accountname:accountname},function(data){
                //使用jquery动态给easyui-numberbox赋值
                $("#beginningbalance").numberbox('setValue', data.beginningbalance);
        },'json');
};
//json数据如下:
{"beginningbalance":0,"incomeamount":0,"spendingamount":0}