<%
layout("/layouts/private.html"){
%>
新建 busOrder
删除选中
商品主图
营销单号
商品名称
商品Id
商品链接
优惠券链接
渠道
业务员
订单状态
订单状态
订单状态
订单状态
订单状态
订单状态
操作
×
删除busOrder
busOrder删除后无法恢复。
确定删除吗?
取 消
确 定
var datatable;
function initDatatable() {
datatable = $('.datatable').DataTable({
"dom": '<"toolbar">frtip',
"searching":false,
"processing": false,
"serverSide": true,
"select": true,
"ordering": true,
"language": {
"url": "${base}/assets/plugins/datatables/cn.json"
},
"preDrawCallback": function () {
sublime.showLoadingbar($(".main-content"));
},
"drawCallback": function () {
sublime.closeLoadingbar($(".main-content"));
},
"ajax": {
"url": "${base}/private/business/bus_orders/data",
"type": "post",
"data": function (d) {
d.unitid = $('#unitid').val();
}
},
// "order": [[0, "desc"]],
"columns": [
{"data": "goodsPicMain", "bSortable": true},
{"data": "marketingNum", "bSortable": true},
{"data": "goodsName", "bSortable": true},
{"data": "goodsId", "bSortable": true},
{"data": "goodsUrl", "bSortable": true},
{"data": "couponUrl", "bSortable": true},
{"data": "channel", "bSortable": true},
{"data": "salesman", "bSortable": true},
{"data": "busOrderStatus", "bSortable": true},
{"data": "busOrderStatus_1", "bSortable": true},
{"data": "busOrderStatus_2", "bSortable": true},
{"data": "busOrderStatus_3", "bSortable": true},
{"data": "busOrderStatus_4", "bSortable": true},
{"data": "busOrderStatus_5", "bSortable": true},
],
"columnDefs": [
{
"render": function (data, type, row) {
return '' +
' ' +
'查看信息' +
'修改信息' +
'' +
'删除' +
'';
},
"targets": 14
}
]
});
datatable.on('click', 'tr', function () {
$(this).toggleClass('selected');
});
$("#searchBtn").on('click', function () {
datatable.ajax.reload();
});
}
function del(id) {
var dialog = $("#dialogDelete");
dialog.modal("show");
dialog.find("#okDel").unbind("click");
dialog.find("#okDel").bind("click", function (event) {
var btn = $(this);
btn.button("loading");
$.post("${base}/private/business/bus_orders/delete/" + id, {}, function (data) {
if (data.code == 0) {
datatable.ajax.reload(null,false);
} else {
Toast.error(data.msg);
}
//重置按钮状态,关闭提示框
btn.button("reset");
dialog.modal("hide");
}, "json");
});
}
function delCheck() {
var chks = datatable.rows('.selected').data();
if (chks.length > 0) {
var ids = [];
$.each(datatable.rows('.selected').data(), function (i, n) {
ids.push(n.id);
});
var dialog = $("#dialogDelete");
dialog.modal("show");
dialog.find("#okDel").unbind("click");
dialog.find("#okDel").bind("click", function (event) {
var btn = $(this);
btn.button("loading");
$.post("${base}/private/business/bus_orders/delete", {ids: ids.toString()}, function (data) {
if (data.code == 0) {
datatable.ajax.reload(null,false);
} else {
Toast.error(data.msg);
}
btn.button("reset");
dialog.modal("hide");
}, "json");
});
} else {
Toast.warning("请先选择要删除的busOrder!");
}
}
$(function () {
initDatatable();
});
<%}%>