[color=red]//点击选择按钮,加载跳转到子页面,并加载数据[/color]
function choose()
{
openWinW2('<%=basePath %>recall/gotoBatch.xhtml?prodcode='+$("#prodcode").textbox("getValue"),
"产品批次查询","650px","350px",false,false);
}
[color=red]子页面的列表[/color]
$('#tt').datagrid({
url: '<%=basePath %>recall/queryProdbatchList.xhtml',
queryParams: data_attr,
singleSelect: true,
rownumbers: true,
pagination: true,
pageNumber: 1,
pageSize:10,
columns:[[
{field:'detail_id',title:'产品批次',align:'center',width:100,hidden:'true'},
{field:'prodbatch',title:'产品批次',align:'center',width:100},
{field:'prodname',title:'产品名称',align:'center',width:100},
{field:'custentid',title:'客户企业ID',align:'center',width:100},
{field:'custentname',title:'客户企业名称',align:'center',width:100},
{field:'prodmodel',title:'规格',align:'center',width:100},
{field:'salesamount',title:'产品数量',align:'center',width:100},
{field:'detailid',title:'操作',halign:'center',align:'center',width:100,
formatter: function (value, rowData, rowIndex) {
return "<a href='javascript:void(0)' οnclick=\"[color=red]chooseBack[/color]('"+rowData.prodbatch+"','"+rowData.custentid+"','"+rowData.custentname+"','"+rowData.prodmodel+"','"+rowData.salesamount+"')\">选择</a>"
}
}
]]
});
[color=red]--传值 [/color]
function chooseBack(prodbatch,custentid,custentname,prodmodel,salesamount){
window.parent.selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount);
window.parent.closeWin("产品批次查询");
}
[color=red]
--父页面接收
[/color]
function selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount){
$("#prodbatch").textbox("setValue",prodbatch);
$("#cust_ent_id").val(custentid);
$("#cust_ent_name").textbox("setValue",custentname);
$("#prodmodel").textbox("setValue",prodmodel);
$("#recallamount").textbox("setValue",salesamount);
}
function choose()
{
openWinW2('<%=basePath %>recall/gotoBatch.xhtml?prodcode='+$("#prodcode").textbox("getValue"),
"产品批次查询","650px","350px",false,false);
}
[color=red]子页面的列表[/color]
$('#tt').datagrid({
url: '<%=basePath %>recall/queryProdbatchList.xhtml',
queryParams: data_attr,
singleSelect: true,
rownumbers: true,
pagination: true,
pageNumber: 1,
pageSize:10,
columns:[[
{field:'detail_id',title:'产品批次',align:'center',width:100,hidden:'true'},
{field:'prodbatch',title:'产品批次',align:'center',width:100},
{field:'prodname',title:'产品名称',align:'center',width:100},
{field:'custentid',title:'客户企业ID',align:'center',width:100},
{field:'custentname',title:'客户企业名称',align:'center',width:100},
{field:'prodmodel',title:'规格',align:'center',width:100},
{field:'salesamount',title:'产品数量',align:'center',width:100},
{field:'detailid',title:'操作',halign:'center',align:'center',width:100,
formatter: function (value, rowData, rowIndex) {
return "<a href='javascript:void(0)' οnclick=\"[color=red]chooseBack[/color]('"+rowData.prodbatch+"','"+rowData.custentid+"','"+rowData.custentname+"','"+rowData.prodmodel+"','"+rowData.salesamount+"')\">选择</a>"
}
}
]]
});
[color=red]--传值 [/color]
function chooseBack(prodbatch,custentid,custentname,prodmodel,salesamount){
window.parent.selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount);
window.parent.closeWin("产品批次查询");
}
[color=red]
--父页面接收
[/color]
function selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount){
$("#prodbatch").textbox("setValue",prodbatch);
$("#cust_ent_id").val(custentid);
$("#cust_ent_name").textbox("setValue",custentname);
$("#prodmodel").textbox("setValue",prodmodel);
$("#recallamount").textbox("setValue",salesamount);
}