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
| @{
| 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: true, selectcol: "Id" };
| dataCol = [
| { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
| {
| label: '电话卡号', name: 'simcard', labtype: 'txt', hidden: false, width: 150,
| formatter: function (cellvalue, options, rowObject) {
| return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/Sim/Edit?id=" + rowObject.Id + "')\" >" + cellvalue + "</a>";
| }
| },
| { label: '使用人员', name: 'username', labtype: 'txt', hidden: false, width: 150 },
| { label: '电话补贴', name: 'cardproChs', labtype: 'txt', hidden: false, width: 100 },
| { label: '更新日期', name: 'up_time', labtype: 'txt', hidden: false, width: 150 },
| ];
| dataUrl = "/Sim/GetList";
| searchCol = [
| { label: '电话卡号', name: 'simcard', labtype: 'txt', hidden: false, cwidth: '5%', cccwidth: '8%' },
| { label: '使用人员', name: 'username', labtype: 'txt', hidden: false, cwidth: '5%', cccwidth: '8%' },
| ];
|
| 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>
| }
|
|