songjun
2024-09-05 a3302fda10ff21ed3700be462ad560163ca13f14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
@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>