username@email.com
2022-08-27 6e2b929cf381e2320ba6e7dec56c0371124d2b51
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
@using DTO;
@{
    ViewBag.Title = "MemoBook";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
 
    List<PageEntity> ActionInfo2 = ViewData["ActionInfo2"] as List<PageEntity>;
}
@{PltUser user = (PltUser)ViewData["curentuser"];}
@section headerStyle{
    <script type="text/javascript">
        var Dept = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Dept))';
        var User = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.User))';
        var Wancheng = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Wancheng))';
 
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
            {
                label: '安排时间', name: 'Createtime', labtype: 'txt', width: 100, hidden: false,
                formatter: function (cellvalue, options, rowObject) {
                    return   new Date(cellvalue).Format("yyyy-MM-dd");
                }
            },
            { label: '工作内容', name: 'Context', labtype: 'txt', width: 300, hidden: false },
            {
                label: '要求完成时间', name: 'TimeName', labtype: 'txt', width: 100, hidden: false
            },
            { label: '办理情况', name: 'BanLi', labtype: 'txt', width: 300, hidden: false },
            { label: '完成时间', name: 'WanchengTimeName', labtype: 'txt', width: 100, hidden: false },
            {
                label: '工作考核', name: 'KaoHe', labtype: 'txt', width: 100, hidden: false,
                formatter: function (cellvalue, options, rowObject) {
                    if (cellvalue == null || cellvalue == "" ) {
                        return '<a href="javascript: void (0)"  class="Kaohe"  style="display:none;" onclick="kaohe(\'' + rowObject.Rtype + '\',\'' + rowObject.Id + '\');">考核</a>';
                    } else {
                        return rowObject.KaoHeName;
                    }
 
 
                }
            },
            { label: '申诉', name: 'ShenSu', labtype: 'txt', width: 100, hidden: false },
            //{
            //    label: '提醒类型', name: 'Rtype', labtype: 'txt', width: 100, hidden: false,
            //    formatter: function (cellvalue, options, rowObject) {
 
            //        let value = '';
            //        for (var i = 0; i < rtype.length; i++) {
            //            if (rtype[i].code === cellvalue) {
            //                value = rtype[i].label;
            //                break;
            //            }
            //        }
            //        return value;
            //    }
            //},
 
            { label: '安排人', name: 'Creater', labtype: 'txt', width: 100, hidden: true },
            { label: '被安排人', name: 'ToUserId', labtype: 'txt', width: 100, hidden: false },
 
            {
                label: '操作', name: 'RecStatus', align: "center", align: "center", sortable: false, width: 100, labtype: 'txt',
                formatter: function (cellvalue, options, rowObject) {
                    return '<a href="javascript:void(0)"  class="Update"  style="display:none;" onclick="edit(\'' + rowObject.Rtype + '\',\'' + rowObject.Id + '\');"> <span style="background: #ECF3FF;">  修改 </span> </a > '
                        + ' <a href="javascript:void(0)"  class="Delete"  style="display:none;" onclick="del(\'' + rowObject.Id + '\');">  <span style="background: #ECF3FF;"> 删除 </span></a>'
                }
            },
 
            { label: '状态', name: 'RecStatus', labtype: 'txt', hidden: true },
            { label: '创建人', name: 'Creater', labtype: 'txt', hidden: true },
            { label: '创建时间', name: 'Createtime', labtype: 'txt', hidden: true },
            { label: '修改人', name: 'Modifier', labtype: 'txt', hidden: true },
            { label: '修改时间', name: 'Modifytime', labtype: 'txt', hidden: true }
 
        ];
        dataUrl = "/DailyManagement/GetWorkAnPaiList?Creater=" + "@user.Id" +"&Rtype=3"
        searchCol = [
            { label: '时间', name: 'Createtime', labtype: 'datearea', hidden: false },
            { label: '工作部门', name: 'WorkDept', labtype: 'combox', hidden: false,  data: JSON.parse(Dept)  /*,cwidth: '5%', cccwidth: '28%' */ },
 
            { label: '职工姓名', name: 'ToUserId', labtype: 'combox', hidden: false, data: JSON.parse(User)  /*,cwidth: '5%', cccwidth: '28%' */ },
            { label: '完成情况', name: 'HaveRead', labtype: 'combox', hidden: false, data: JSON.parse(Wancheng)  /*,cwidth: '5%', cccwidth: '28%' */ },
        ];
 
        var _pageAdd = function () {
            OpenWindow("安排工作", "500px", "600px", "/DailyManagement/EditWorkAnPai/?Rtype=3");
        }
 
        function _pageMemo() {
            OpenWindow("安排工作", "500px", "600px", "/DailyManagement/EditWorkAnPai/?Rtype=3");
        }
 
        function edit(op, id) {
            let caption;
            if (op === "3") {
                caption = "安排工作";
            } else {
                caption = "安排工作";
            }
            OpenWindow(caption, "500px", "600px", "/DailyManagement/EditWorkAnPai/?id=" + id);
 
        }
 
        function kaohe(op, id) {
            let caption;
            if (op === "3") {
                caption = "安排工作";
            } else {
                caption = "安排工作";
            }
            OpenWindow(caption, "500px", "600px", "/DailyManagement/EditWorkKaoHe/?id=" + id);
 
        }
 
        function del(id) {
            $.ajax({
                type: "POST",
                url: "/DailyManagement/ModifyWorkAnPaiStatus?id=" + id + "&isReaded=false",
                dataType: "json",
                global: false,
                async: false,
                data: '',
                success: function (data) {
 
 
                    if (data.Result) {
                        window._reloadPageData();
                        toastr.success("删除成功");
 
                    }
                    else {
                        toastr.error(data.Message);
                    }
 
                },
                error: function () {
 
                    toastr.error("删除失败");
                }
            });
        }
 
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
 
        }
 
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
                /**/
            }
        }
 
 
 
    </script>
}
 
@section footerScripts{
    <script type="text/javascript">
 
        function send() {
 
            var msg = $("#PBSWorkDept");
 
 
            if (msg.length > 0) {
                $("#PBSWorkDept").change(function () {
                    var checkDeptId = $("#PBSWorkDept").val();
                    $.ajax({
                        type: "GET",
                        url: "/User/GetList?DeptId=" + checkDeptId,
                        dataType: "json",
                        global: false,
                        data: "",
                        success: function (data) {
 
                            var city = $("#PBSToUserId");
                            city.find('option').remove();
                            var aaa = '<option value="" hassubinfo="true">&nbsp;</option>';
                            city.append(aaa);
                            if (data.length > 0) {
                                for (var i = 0; i < data.length; i++) {
 
                                    var o = '<option value="' + data[i].Id + '" hassubinfo="true">' + data[i].UserName + '</option>';
                                    city.append(o);
                                }
                            }
                            $("#PBSToUserId").trigger('chosen:updated');//更新选项
                        },
                        error: function () {
 
 
                            parent.layer.msg('失败', { icon: 5 });
                        }
                    });
                });
 
            } else {
                setTimeout(send, 1000);
            }
        }
 
 
        send();
 
 
 
 
 
 
 
 
        function sendZhiwustatus() {
 
            var msg = $("#PBSHaveRead");
 
 
            if (msg.length > 0) {
                $("#PBSHaveRead").val("0");
                $("#PBSHaveRead").trigger('chosen:updated');//更新选项
                _pageSearch();
            } else {
                setTimeout(sendZhiwustatus, 300);
            }
        }
 
 
        sendZhiwustatus();
 
 
        var ActionInfo22 = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ActionInfo2))';
 
        var _afterLoadDataload = function (xhr) {
            var data = JSON.parse(ActionInfo22);
            for (var o in data) {
                //alert(o);
                //alert(data[o]);
                /* alert("PageShortcut:" + data[o].PageShortcut + " PageName:" + data[o].PageName);*/
                $("." + data[o].PageShortcut).show();
 
            }
 
 
        };
    </script>
}