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
@{
    ViewBag.Title = "工资核准";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
}
 
<link href="~/css/jquery-confirm.css" rel="stylesheet">
<script src="~/js/jquery-confirm.js" type="text/javascript"></script>
 
@section headerStyle{
   
    <script type="text/javascript">
 
        var dept = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.dept))';
 
        gridConfig = { multiselect: false, selectcol: "Id" };
        shrinkToFit = false;
        footerrow = false;
 
        dataCol = [
            { label: '序号', name: 'Id', labtype: 'txt', hidden: true },
            { label: '工号', name: 'Usernumber', labtype: 'txt', hidden: false, width: 80},
            {
                label: '姓名', name: 'UserName', labtype: 'txt', hidden: false, width: 60,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('工资核准','60%','55%', '/SalaryCheck/Edit?id=" + rowObject.Id + "')\"  >" + cellvalue + "</a>";
                }
            },
            { label: '工资月份', name: 'YearMonth', labtype: 'txt', hidden: false, width: 80 },
            {
                label: '状态', name: 'IslockChs', labtype: 'txt', hidden: false, width: 60, formatter: function (cellvalue, options, rowObject) {
                    switch (rowObject.Islock) {
                        case 'S':
                            return '<b style="color: red">' + cellvalue + '</b>';
 
                        case 'D':
                            return '<b style="color: blue">' + cellvalue + '</b>';
 
                        default:
                            return cellvalue;
                    }
                    //if ( == 'S') {
                    //    return '<b style="color: red">' + cellvalue + '</b>';
                    //} else {
                    //    return cellvalue;
                    //}
                }
            },
            { label: '工作部门', name: 'DeptName', labtype: 'txt', hidden: false, width: 80 },
            { label: '基本工资', name: 'Jibengongzi', labtype: 'txt', hidden: false, width: 60 },
            { label: '保密费', name: 'Baomifei', labtype: 'txt', hidden: false, width: 60 },
            { label: '工作补贴', name: 'Gongzuobutie', labtype: 'txt', hidden: false, width: 60 },
            { label: '加班工资', name: 'Jiabangongzi', labtype: 'txt', hidden: false, width: 60 },
            { label: '社保', name: 'Shebao', labtype: 'txt', hidden: false, width: 60 },
            { label: '电话补贴', name: 'DianhuabutieChs', labtype: 'txt', hidden: false, width: 60 },
            { label: '全勤奖', name: 'Quanqinjiang', labtype: 'txt', hidden: false, width: 60 },
            { label: '交通补贴', name: 'Jiaotngbutie', labtype: 'txt', hidden: false, width: 60 },
            { label: '绩效提成', name: 'Jixiaoticheng', labtype: 'txt', hidden: false, width: 60 },
            { label: '奖金', name: 'Jiangjin', labtype: 'txt', hidden: false, width: 60 },
            { label: '补发工资', name: 'Bufagongzi', labtype: 'txt', hidden: false, width: 60 },
            { label: '合计', name: 'sum_fgz', labtype: 'txt', hidden: false, width: 60 },
 
            { label: '社保', name: 'Shebaokou', labtype: 'txt', hidden: false, width: 60 },
            { label: '个税', name: 'Geshui', labtype: 'txt', hidden: false, width: 60 },
            { label: '电话费', name: 'Dianhuafei', labtype: 'txt', hidden: false, width: 60 },
            { label: '缺勤', name: 'Queqin', labtype: 'txt', hidden: false, width: 60 },
            { label: '罚款', name: 'Fakuan', labtype: 'txt', hidden: false, width: 60 },
            { label: '赔偿', name: 'Peichang', labtype: 'txt', hidden: false, width: 60 },
            { label: '纠错', name: 'Jiucuo', labtype: 'txt', hidden: false, width: 60 },
            { label: '合计', name: 'sum_kgz', labtype: 'txt', hidden: false, width: 60 },
 
            { label: '到账工资', name: 'Daozhanggongzi', labtype: 'txt', hidden: false, width: 60 },
            { label: '预发工资', name: 'Yufagongzi', labtype: 'txt', hidden: false, width: 60 },
            { label: '预发工资合计', name: 'Yufagongziheji', labtype: 'txt', hidden: false, width: 60 },
        ];
        dataUrl = "/SalaryCheck/GetList?YearMonth222=" + getNowFormatDate();
        searchCol = [
            { label: '月份', name: 'YearMonth', labtype: 'monthdate', hidden: false, cwidth: '5%', cccwidth: '8%' },
            { label: '工作部门', name: 'DeptId', labtype: 'combox', hidden: false, data: JSON.parse(dept) },
            { label: '职工姓名', name: 'UserName', labtype: 'txt', hidden: false },
        ];
        //var _pageSearch = function () {
        //    $("#jqGrid").jqGrid('setGridParam', {
        //        url: '/SalaryCheck/GetList', postData: jsons, page: 1
        //    }); //重新载入
        //    var jsons = GetSearchEnd();
        //    if (jsons == false) {
        //        msg.info("请录入查询条件");
        //        return false;
        //    }
        //    LoadGrid(jsons);
        //}
 
        $(function () {
            $("#PBSYearMonth").val(getNowFormatDate());
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ 'overflow-x': 'scroll' });
          
            jQuery("#jqGrid").jqGrid('setGroupHeaders', {
                useColSpanStyle: true,
                groupHeaders: [
                    { startColumnName: 'Jibengongzi', numberOfColumns: 12, titleText: '应发工资' },
                    { startColumnName: 'Shebaokou', numberOfColumns: 8, titleText: '应扣工资' }
                ]
            });
          
        });
 
 
        var _pageSearch = function () {
            $("#jqGrid").jqGrid('setGridParam', {
                url: '/SalaryCheck/GetList', postData: jsons, page: 1
            }); //重新载入
            var jsons = GetSearchEnd();
            if (jsons == false) {
                msg.info("请录入查询条件");
                return false;
            }
            LoadGrid(jsons);
        }
 
 
        function getNowFormatDate() {
            var date = new Date();
            var seperator1 = "-";
            var year = date.getFullYear();
            var month = date.getMonth();
            if (month == 0) {
                year = year - 1;
                month = 12;
            }
            var strDate = date.getDate();
            if (month >= 1 && month <= 9) {
                month = "0" + month;
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = "0" + strDate;
            }
            var currentdate = year + seperator1 + month;//+ seperator1 + strDate;
            return currentdate;
        }
 
        var _pageEdit = function () {
            var id = jQuery("#jqGrid").jqGrid('getGridParam', 'selrow');
            if (id) {
                OpenWindow('工资核准', '60%', '65%', '/SalaryCheck/Edit?id=' + id );
            } else {
                toastr.error("请先选中1条记录!");
            }
        };
 
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
 
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
                /**/
            }
        }
    </script>
}