username@email.com
2021-06-21 0f5218bb8ed4ad8fa9b8b2f089efd624dc6e9f07
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
@{
    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">
 
        gridConfig = { multiselect: false, selectcol: "id" };
        dataCol = [
            { label: '序号', name: 'id', labtype: 'txt', hidden: false, width: 50 },
            { label: '账单日期', name: 'accountMonth', labtype: 'txt', hidden: false, width: 150 },
            {
                label: '电话卡号', name: 'simcard', labtype: 'txt', hidden: false, width: 150,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('编辑电话费用','98%','90%', '/SimCost/Edit?id=" + rowObject.id + "')\"  >" + cellvalue + "</a>";
                }
            },
            { label: '使用人员', name: 'username', labtype: 'txt', hidden: false, width: 150 },
            { label: '电话单金额', name: 'bill_amount', labtype: 'txt', hidden: false, width: 100 },
            { label: '电话补贴金额', name: 'allow_amount', labtype: 'txt', hidden: false, width: 100 },
            { label: '差异金额', name: 'amount', labtype: 'txt', hidden: false, width: 100 },
            { label: '状态', name: 'statusChs', labtype: 'txt', hidden: false, width: 100 },
            { label: '更新日期', name: 'up_time', labtype: 'txt', hidden: false },
        ];
        dataUrl = "/SimCost/GetList";
        searchCol = [
            { label: '时间', name: 'searchtime', labtype: 'datearea', hidden: false },
            { label: '电话卡号', name: 'searchsim', labtype: 'txt', hidden: false, cwidth: '5%', cccwidth: '8%' }
        ];
 
        var _pageAdd = function () {
            OpenWindow("新增电话费用", "98%", "90%", "/SimCost/Edit/");
        }
 
        var _pageUnBind = function () {
            var db = jQuery('#jqGrid').jqGrid('getGridParam', 'selarrrow');
            if (db.length > 0) {
                $.confirm({
                    title: '解除绑定操作确认',
                    content: '此操作将解除所选定电话卡和人员绑定关系,确认要继续吗?',
                    type: 'green',
                    icon: 'glyphicon glyphicon-question-sign',
                    buttons: {
                        ok: {
                            text: '确认',
                            btnClass: 'btn-primary',
                            action: function () {
                                $.ajax({
                                    type: "POST",
                                    url: "/Sim/UnBindSim?id="+db,
                                    dataType: "json",
                                    global: false,
                                    success: function (data) {
 
                                        if (data.Result) {
                                            jQuery('#jqGrid').jqGrid().trigger('reloadGrid');
                                            
                                            parent.layer.msg('设置成功', { icon: 6 });                                           
                                        }
                                        else {
                                            parent.layer.msg(data.Message, { icon: 5 });
                                        }
                                    },
                                    error: function () {
                                        parent.layer.msg('失败', { icon: 5 });
                                    }
                                });
                            }
                        },
                        cancel: {
                            text: '取消',
                            btnClass: 'btn-primary'
                        }
                    }
                });
            }
            else {
                $.alert("请先选择需要解绑的电话卡!");
            }
 
        }
 
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
 
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
                /**/
            }
        }
    </script>
}