62,243
社区成员




<script>
$(function () {
//初始哈bootstrap table
var tb = new tableInit();
tb.Init();
$("#btnQuery").click(function () {
$("#rideInfo").bootstrapTable('refresh');
})
})
$(document).on("keydown", ".empTypeahead", function (e) {
$(".empTypeahead").typeahead({
minLength: 2,
source: function (query, process) {
$.ajax({
url: '/SCRP0101/GetFuzzyEmps',
dataType: 'JSON',
async: true,
data: { appNo: query },
success: function (data) {
var arr = [];
for (i in data) {
arr.push(data[i]['appNo']);
}
process(arr);
}
});
}
});
})
//定義bootstrap table
var tableInit = function () {
var rideTB = new Object();
rideTB.Init = function () {
$("#rideInfo").bootstrapTable({
url: "/SCRP0101/GetRideInfo",
method: "get",
classes: "table table-hover table-condensed",
striped: true,//隔行换色
cache: false,//禁用缓存
toolbar: "#toolbar",
queryParams: queryParams,
detailView: true,
pagination: true,//启动分页
sidePagination: 'client',//分页方式
pageNumber: 1,//初始化table时显示的页码
pageSize: 10,//每页条目
showFooter: false,//是否显示列脚
showPaginationSwitch: true,//是否显示 数据条数选择框
sortable: true,//排序
search: true,//启用搜索
showColumns: true,//是否显示 内容列下拉框
showRefresh: true,//显示刷新按钮
idField: 'APPNO',//key值栏位
onlyInfoPagination: true,//设置为 true 只显示总数据数,而不显示分页按钮。需要 pagination='True'
searchAlign: 'left',
buttonsAlign: 'left',
onExpandRow: function (index, row, $detail) {//點擊datagrid 展開按鈕事件
$.ajax({
type: 'GET',
cache: false,
url: '/SCRP0101/GetDetailsByCarNo',
data: { appNo: row['APPNO'] },
success: function (data) {
$detail.html(data);
}
});
},
onLoadError: function (status) {
toastr.error(status);
}
})
};
return rideTB;
};
public PartialViewResult GetDetailsByCarNo(string appNo)
{
IList<DaysSendCar> concealDaysSendCar = ModelConvertHelper<DaysSendCar>.ConvertToModel(DaysSendCar.GetConcealDaysSendCar(appNo));
return PartialView("_SendCarView", concealDaysSendCar);
}
@model SendCar.Web.Models.DaysSendCar
<table class="detailView table table-bordered table-hover table-condensed table-responsive">
<thead>
<tr class="info">
<th>申請單號</th>
<th>單據狀態</th>
<th>申請人</th>
<th>申請人部門?</th>
<th>申請人聯絡方式</th>
<th>用車日期</th>
</tr>
</thead>
<tbody>
<tr class="info">
<td>@Model.APPNO</td>
<td>@Model.STATUS</td>
<td>@Model.APPEMPLNAME</td>
<td>@Model.XXX</td>
<td>@Model.APPPHONENO</td>
<td>@Model.APPDT</td>
</tr>
</tbody>
</table>
<style>
.detailView {
font-size: 12px !important;
}
</style>