@{
|
ViewBag.Title = "报名申请管理";
|
Layout = "~/Views/Shared/Master.cshtml";
|
}
|
|
@model sbcLabSystem.Models.Backstage.UserRequestViewModel1
|
<script>
|
|
var viewModel;
|
$(function () {
|
viewModel = new myViewModel_User(@Html.Raw(Json.Encode(Model)));
|
ko.applyBindings(viewModel, $(".container")[0]);
|
});
|
function myViewModel_User(data)
|
{
|
var self = this;
|
self.date1=ko.observable();
|
self.date2=ko.observable();
|
self.sou = function ()
|
{
|
var x = document.getElementById("myDate1").value;
|
var y = document.getElementById("myDate2").value;
|
console.log(JSON.stringify({
|
Page: "1",
|
date1: x,
|
date2: y,
|
}));
|
if (x != "" && y != "") {
|
$.ajax({
|
type: "post",
|
url: '@Url.Action("IndexSou", "Backstage")',
|
dataType: 'json',
|
cache: false,
|
contentType: 'application/json; charset=utf-8',
|
data: JSON.stringify({
|
Page: "1",
|
date1: x,
|
date2: y,
|
}),
|
success: function (json) {
|
|
ko.mapping.fromJS(json, mapping, self);
|
},
|
error: function (err) {
|
}
|
});
|
}
|
else {
|
alert("没有选择日期范围");
|
}
|
}
|
self.xiazai = function ()
|
{
|
var x = document.getElementById("myDate1").value;
|
var y = document.getElementById("myDate2").value;
|
if (x != "" && y != "") {
|
window.location.href = "@Url.Action("LabExcelDate", "Backstage")"+"?date1="+x+"&date2="+y;
|
|
}
|
else {
|
alert("没有选择日期范围");
|
}
|
}
|
|
self.changePage = function (index) {
|
var x = document.getElementById("myDate1").value;
|
var y = document.getElementById("myDate2").value;
|
if (x != "" && y != "") {
|
|
$.ajax({
|
type: "post",
|
url: '@Url.Action("PageIndex", "Backstage")',
|
dataType: 'json',
|
cache: false,
|
contentType: 'application/json; charset=utf-8',
|
data: JSON.stringify({
|
Page: index,
|
State: self.StateId(),
|
date1: x,
|
date2: y,
|
}),
|
success: function (json) {
|
|
ko.mapping.fromJS(json, mapping, self);
|
},
|
error: function (err) {
|
}
|
});
|
}
|
else {
|
|
$.ajax({
|
type: "post",
|
url: '@Url.Action("PageIndex", "Backstage")',
|
dataType: 'json',
|
cache: false,
|
contentType: 'application/json; charset=utf-8',
|
data: JSON.stringify({
|
Page: index,
|
State: self.StateId(),
|
}),
|
success: function (json) {
|
|
ko.mapping.fromJS(json, mapping, self);
|
},
|
error: function (err) {
|
}
|
});
|
}
|
|
}
|
self.stateNo = function (data) {
|
|
location.href = "@Url.Action("Index", "Backstage")" + "?Page=" + 1 + "&State=" + 0;
|
}
|
self.stateOff = function (data) {
|
|
location.href = "@Url.Action("Index", "Backstage")" + "?Page=" + 1 + "&State=" + 1;
|
}
|
ko.mapping.fromJS(data, mapping, self);
|
//console.log(ko.toJS(self));
|
|
self.classA = ko.computed(function () {
|
if (self.StateId() == 0) {
|
return "btn-info";
|
}
|
}, self)
|
self.classB = ko.computed(function () {
|
if (self.StateId() == 1) {
|
return "btn-info";
|
}
|
}, self)
|
|
}
|
var mapping = {
|
'UserRequestInfoList': {
|
create: function (options) {
|
return new UserRequestInfoList(options.data);
|
}
|
}
|
}
|
function UserRequestInfoList(data)
|
{
|
var self = this;
|
self.dizhi = data.Province + data.City + data.District;
|
|
self.updateTime = ko.computed(function () {
|
return formatDateTime(self.UpdateTime());
|
}, self)
|
self.project = ko.computed(function () {
|
if (self.ProjectId() == 1)
|
{
|
return "项目一";
|
}
|
if (self.ProjectId() == 2) {
|
return "项目二";
|
}
|
if (self.ProjectId() == 3) {
|
return "项目三";
|
}
|
if (self.ProjectId() == 4) {
|
return "项目四 ";
|
}
|
}, self);
|
self.dateTime = ko.computed(function () {
|
return formatDateTime(self.RequestTime());
|
}, self)
|
self.delete2 = function ()
|
{
|
if (confirm("你确定删除吗?")) {
|
DoAjaxPost('@Url.Action("DeleteLab", "Backstage")' + '?ID=' + self.Id(),
|
"",
|
function (data) {
|
window.location.href = "@Url.Action("index", "Backstage")";
|
});
|
}
|
}
|
self.Detailed = function ()
|
{
|
location.href = "@Url.Action("CheckLab", "Backstage")" + "?Id=" + self.Id() + "&CompanyName=" + self.CompanyName();
|
}
|
self.Detailed2 = function () {
|
location.href = "@Url.Action("AddLab", "Backstage")" + "?LabId=" + self.Id() + "&state="+1;
|
}
|
ko.mapping.fromJS(data, {}, self)
|
}
|
|
</script>
|
|
<div class="container">
|
<div class="row" style="width: 99.8%; overflow: auto;">
|
<div class="table-responsive" style="width: 3000px; overflow: hidden;">
|
<table class="table table-bordered" >
|
<caption>
|
<button type="button" class="btn" data-bind="attr:{class:classA},click:stateNo">
|
待审核申请
|
</button>
|
<button type="button" class="btn" data-bind="attr:{class:classB},click:stateOff">
|
已审核申请
|
</button>
|
|
<p data-bind="visible:StateId()==1">
|
<label>日期范围:</label>
|
<input type="date" id="myDate1" data-bind="value:date1" />到<input type="date" id="myDate2" data-bind="value:date2" />
|
<button data-bind="click:sou">
|
<span class="glyphicon glyphicon-search"></span>
|
</button>
|
<button data-bind="click:xiazai">
|
<span class="glyphicon glyphicon-download-alt">下载</span>
|
</button>
|
</p>
|
|
</caption>
|
<thead style="background:#f1ebeb">
|
<tr>
|
<th>操作</th>
|
<th>修改日期</th>
|
<th>实验室编号</th>
|
<th>单位名称</th>
|
<th>实验室名称</th>
|
<th>地址</th>
|
<th>所在</th>
|
<th>参加项目</th>
|
<th>申请时间</th>
|
<th>负责人</th>
|
<th>固话</th>
|
<th>传真</th>
|
<th>手机号码</th>
|
<th>邮箱</th>
|
<th>操作人</th>
|
<th>固话</th>
|
<th>传真</th>
|
<th>手机号码</th>
|
<th>邮箱</th>
|
</tr>
|
</thead>
|
<tbody data-bind="foreach:UserRequestInfoList">
|
<tr>
|
<td >
|
<span>
|
<button type="button" class="btn btn-info btn-xs" data-bind="click:Detailed,style:{display:State()>0?'none':'inline-block'}">
|
有效
|
</button>
|
<button type="button" class="btn btn-danger btn-xs" data-bind="click:delete2,style:{display:State()>0?'none':'inline-block'}">
|
无效
|
</button>
|
<button type="button" class="btn btn-danger btn-xs" data-bind="click:Detailed2,style:{display:State()>0?'inline-block':'none'}">
|
查看
|
</button>
|
</span>
|
</td>
|
<td data-bind="text:updateTime"></td>
|
<td data-bind="text:LabCode"></td>
|
|
<td data-bind="text:CompanyName"></td>
|
<td data-bind="text:LabName"></td>
|
<td data-bind="text:Address"></td>
|
<td data-bind="text:dizhi"></td>
|
<td data-bind="text:project"></td>
|
<td data-bind="text:dateTime"></td>
|
<td data-bind="text:ManagerName"></td>
|
<td data-bind="text:ManagerPhone"></td>
|
<td data-bind="text:ManagerFax"></td>
|
<td data-bind="text:ManagerMobile"></td>
|
<td data-bind="text:ManagerEmail"></td>
|
<td data-bind="text:OperatorName"></td>
|
<td data-bind="text:OperatorPhone"></td>
|
<td data-bind="text:OperatorFax"></td>
|
<td data-bind="text:OperatorMobile"></td>
|
<td data-bind="text:OperatorEmail"></td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
<nav>
|
<ul class="pagination" data-bind="foreach:Pages">
|
<li data-bind="if:$data==0" style="background:#ff0000">
|
<a href="javascript:void(0);" aria-label="Previous" data-bind="click: function() { $root.changePage(0) }">
|
<span aria-hidden="true">«</span>
|
</a>
|
</li>
|
<li data-bind="if:$data!=0 && $data!=999,css:{active:$data==$root.CurrentPageIndex()}">
|
<a href="javascript:void(0);" data-bind="text:$data,click: function() { $root.changePage($data) }"></a>
|
</li>
|
<li data-bind="if:$data==999">
|
<a href="javascript:void(0);" aria-label="Next" data-bind="click: function() { $root.changePage(999) }">
|
<span aria-hidden="true">»</span>
|
</a>
|
</li>
|
</ul>
|
</nav>
|
|
</div>
|