<!-- 销售订单 审批相关 -->
<action name="salesOrderApproval_*" method="{1}" class="xx.xxx.xxAction">
<result type="json">
<param name="root">ajaxResultMap</param>
<param name="contentType">text/html</param>
</result>
</action>
</package>
二、根据输入内容动态加载:
前端JS代码:
/*客户名称自动匹配*/
function customerAutoComplete(){
$("#customerFullName").autocomplete(encodeURI("/approvalajax/salesOrderApproval_findCustomerList"), {
/**加自定义表头**/
tableHead: "<div><span style='width:40%' class='col-1'>客户编码</span> <span style='width:58%' class='col-2'>客户名称</span></div>",
minChars: 0,
width: 310,
matchContains: "true",
autoFill: false,
extraParams: {ledger:$("#ledger").val()},
dataType: 'json',
parse: function(data) {
var rows = [];
if(data == null || data.customerList == null){
return rows;
}
for(var i=0; i<data.customerList.length; i++){
rows[rows.length] = {
data:data.customerList[i], //下拉框显示数据格式
value:data.customerList[i].cusName, //选定后实际数据格式
result:data.customerList[i].cusName //选定后输入框显示数据格式
};
}
return rows;
},
formatItem: function(row, i, max) {
return "<span style='width:40%' class='col-1'>" + row.cusCode + "</span> " + "<span style='width:58%' class='col-2'>" + row.cusName + "</span>";
},
formatMatch: function(row, i, max) {
return row.cusCode+row.cusName;
},
formatResult: function(row) {
return row.cusName;
}
}).result(function(e,data,value,sec){/**加选中后的回调函数**/
clearCustomerInfo();
$("#customerShortName").val(data.cusAbbName);
$("#customerFullName").val(data.cusName);
$("#customerCode").val(data.cusCode);
$("#licensecode").val(data.licensecode);
/*根据选择的客户、账套加载 对应产品线、收付款协议、账期*/
setPLAndPCAndCP(data.cusCode);
/*存货编码*/
addInventoryAutoComplete($("#detailListTbody").find("input[tdTag=inventoryCode]"));
}).bind("unmatch", function(){
clearCustomerInfo();
});
}后台JAVA代码:
/**
* @Fields q 自动填充辅助字符
*/
private String q;
/**
* 异步请求结果.
*/
private Map<String, Object> ajaxResultMap;
/**
* @Description 根据账套异步加载客户列表










