var path = '${pageContext.request.contextPath}/order/exportSale';
$('#form').attr("action", path).submit();
----------jquery Form 提交
$.ajax({
url:'${pageContext.request.contextPath}/order/editSku-json',
type:'post',
data:{"id":id,"sku":newsku},
async : false, //默认为true 异步
error:function(){
alert('ajax error');
},
success:function(data){
var jsondata = eval("("+data+")");
if(!jsondata.result){
alert(jsondata.error);
return;
}
--window.location.reload();
}
});
---------------Ajax 提交
//批量操作
function test(){
var s ="";
$('#list_table [type="checkbox"]:checked').each(function(){
s+=$(this).val()+',';
});
var idList = s.substring(0, s.length-1);
$.post('${contextPath }/order-package/back',
{idList : idList},
function(){
window.location.href="${contextPath }/order-package";
});
}
-------------------获取 ID 进行批量操作
function format(d){
var html = '
+ '
名称SKU订单数量'+ '
包裹数量出货数量单价包装规格'+ '
仓库'$.ajax({
type : "post",
async: false,
url : "${contextPath }/order-package/packageItem",
data : {
id : d.id,
},
success : function(data) {
$.each(data, function(commentIndex, comment){
html += '
'+comment.goodsName+''+comment.sku+''+comment.orderAmount+''+''+comment.packageAmount+' '+comment.shipmentAmount+''+comment.price+' '+comment.specifications+''+'+comment.storeName+''});
html += '
';}
});
return html;
}
-----------返回data数据 拼接html 展示数据