//前台
table.render({
url: core.path,//相对应的esb接口地址
elem: '#weidaopiaoInfo',
contentType: 'application/json',
datatype: 'json',
request: {
pageName: 'page_index', //页码的参数名称,默认:page
limitName: 'page_size' //每页数据量的参数名,默认:limit
},
page: true,
where: {
"request_service": "InvoiceHandle",
"request_item": "SummaryOfNonArrivalTickets",
"login_type": loginType,
"data": {
"日期开始": 入库起始日期,
"日期结束": 入库结束日期,
"市场ID": 部门,
"采购人ID": 采购人ID,
}
},
cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
method: 'post', //提交方式
cols: [[
{ field: '销方名称', title: '销方名称', sort: true },
{ field: '购方名称', title: '购方名称', sort: true },
{ field: '总成本', title: '总成本', sort: true },
{ field: '三个月内', title: '三个月内', sort: true },
{ field: '三到六个月', title: '三到六个月', sort: true },
{ field: '六个月以上', title: '六个月以上', sort: true },
//{ fixed: 'right', width: 70, align: 'center', toolbar: '#barInvoice' }
]],
parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
return {
"code": res.status_code == 200 ? 0 : 1,
"msg": res.msg,
"count": res.data.count,
"data": res.data.data,
"部门": res.data.部门
};
},
done: function (res, curr, count) {
$.each(res.部门, function (index, item) {
$('#部门').append(new Option(item.Name, item.ID));// 下拉菜单里添加元素
});
layui.form.render("select");
},
error: function (data) {
location.href = './login.html'
}
});
//后台代码
public void ProcessRequest(HttpContext context)
{
string RequestData = new StreamReader(context.Request.InputStream, context.Request.ContentEncoding).ReadToEnd();
}