function DeleteCost() {
layui.use('table', function () {
var table = layui.table;
var orderID = getUrlParama("OrderId");
//监听表格复选框选择
var checkStatus = table.checkStatus('CustomerList'); //test即为基础参数id对应的值
var dataS = checkStatus.data;
if (checkStatus.data.length == 0) {
parent.layer.alert("请选择行");
} else if (checkStatus.data.length > 0) {
var mes = "确定要删除选中的【" + checkStatus.data.length + "】行吗?"
parent.layer.confirm(mes, {
btn: ['确定', '取消'] //按钮
}, function () {
var dataInfoId = "";
var firsttypes = "";
for (var i = 0; i < dataS.length; i++) {
dataInfoId += "," + dataS[i].InfoID;
firsttypes += "," + dataS[i].firsttype;
}
dataInfoId = dataInfoId.substr(1);
dataInfoId = "infoIDS=" + dataInfoId + "&firsttypes=" + firsttypes.substr(1) + "&orderID=" + orderID;
$.ajax({
async: false,
type: "POST",
url: "/Cost/CostControler.asmx/DeleteCostOffer",
data: dataInfoId,
dataType: "JSON",
success: function (d) {
parent.layer.msg("删除成功");
table.reload('CustomerList', {
});
}
});
}, function () {
});
}
})
}
layui点击表格checkbox获取id
最新推荐文章于 2024-05-21 13:46:23 发布