62,041
社区成员
发帖
与我相关
我的任务
分享
function postPurchase(rows) {
//递归
var f = $.param(rows[index]);
if (index <= rows.length) {
$.post('/Purchase/AddPusGoods/', f, function (data, statStatus) {
index++;
postPurchase(rows);
})
}
else {
index = 0;
return;
}
}
[HttpPost]
public JsonResult AddPusGoods(YlPurchaseGoods model)
{
int result = new PurchaseService().AddGoods(model);
if (result > 0)
{
return Json(true);
}
else
{
return Json(false);
}
}
var f = $('#form1').serialize()
$.post('/Purchase/add/', f, function (data, statStatus) {
if (data > 0) {
postPurchase(dtrows);
$.messager.alert('消息', "添加进货单成功!");
$("#btn_reset").trigger("click");
//$('#dg').datagrid('reload');
}
else {
$.messager.alert('消息', data)
}
})