@model sbcLabSystem.Models.Backstage.CheckLabViewMod
|
@{
|
ViewBag.Title = "核对实验室";
|
Layout = "~/Views/Shared/Master.cshtml";
|
}
|
|
<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.insert = function (data) {
|
window.location.href = "@Url.Action("AddLab","Backstage")" + "?LabId=" + data.LabId();
|
|
}
|
ko.mapping.fromJS(data, mapping, self);
|
}
|
var mapping = {
|
'ListLabinfo': {
|
create: function (options) {
|
return new ListLabinfo(options.data);
|
}
|
}
|
}
|
function ListLabinfo(data)
|
{
|
console.log(data)
|
var self = this;
|
self.dizhi = data.Province + data.City + data.District;
|
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.seve = function () {
|
alert("确认")
|
$.ajax({
|
type: "post",
|
url: '@Url.Action("SeveEmile", "Backstage")',
|
dataType: 'json',
|
cache: false,
|
contentType: 'application/json; charset=utf-8',
|
data: JSON.stringify(ko.toJS(self)),
|
success: function (data) {
|
alert(data);
|
},
|
error: function (err) {
|
}
|
});
|
}
|
ko.mapping.fromJS(data, {}, self)
|
}
|
</script>
|
<div class="container">
|
<div class="row">
|
<button class="btn btn-danger" >核对实验室</button>
|
</div>
|
<div class="row" style="width: 100%; overflow: auto;">
|
<div class="table-responsive" style="width: 3000px; overflow: hidden;">
|
<table class="table table-striped">
|
|
<thead>
|
<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>
|
</tr>
|
</thead>
|
<tbody data-bind="foreach:ListLabinfo">
|
<tr>
|
<td>
|
|
<span>
|
<button type="button" class="btn btn-info btn-xs" data-bind="click:seve">
|
确认
|
</button>
|
|
</span>
|
</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>
|
<div class="row" style="text-align:right">
|
<button class="btn btn-danger" style="margin-right:10px;" data-bind="click:insert">添加实验室</button>
|
</div>
|
</div>
|