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
| @{
| ViewBag.Title = "HoldPhone";
| Layout = "~/Views/Shared/_Layout_Search.cshtml";
| }
| @section headerStyle{
| <script type="text/javascript">
|
| var LineType = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.LineType))';
| var Intention = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Intention))';
| dataCol = [
| { label: 'id', name: 'Id', labtype: 'txt', hidden: true },
| {
| label: '来电时间', name: 'InTime', labtype: 'txt', width: 100, hidden: false,
| formatter: function (cellvalue, options, rowObject) {
| return '<a href="javascript: void (0)" onclick="edit(\'' + rowObject.Id + '\');">' + new Date(cellvalue).Format("yyyy-MM-dd hh:mm") + '</a>';
| }
| },
| {
| label: '电话类型', name: 'LineType', labtype: 'txt', width: 100, hidden: false,
| formatter: function (cellvalue, options, rowObject) {
| let LType = JSON.parse(LineType);
| let value = '';
| for (var i = 0; i < LType.length; i++) {
| if (LType[i].code === cellvalue) {
| value = LType[i].label;
| break;
| }
| }
| return value;
| }
| },
| { label: '来电单位', name: 'OrderId', labtype: 'txt', hidden: false, width: 200 },
| { label: '电话号码', name: 'Phone', labtype: 'txt', hidden: false, width: 100},
| { label: '电话内容', name: 'Context', labtype: 'txt', hidden: false, width: 200},
| {
| label: '合作意向', name: 'Intention', labtype: 'txt', width: 100, hidden: false,
| formatter: function (cellvalue, options, rowObject) {
| let it = JSON.parse(Intention);
| let value = '';
| for (var i = 0; i < it.length; i++) {
| if (it[i].code === cellvalue) {
| value = it[i].label;
| break;
| }
| }
| return value;
| }
| },
| { label: '接电话人', name: 'UserId', labtype: 'txt', hidden: false, width: 100 },
|
| {
| label: '操作', name: 'RecStatus', align: "center", align: "center", sortable: false, width: 100, labtype: 'txt',
| formatter: function (cellvalue, options, rowObject) {
| return '<a href="javascript:void(0)" onclick="edit(\'' + rowObject.Id + '\');"> <span style="background: #ECF3FF;"> 修改 </span> </a > '
| + ' <a href="javascript:void(0)" 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/GetList";
| searchCol = [
| { label: '来电时间', name: 'Createtime', labtype: 'datearea', hidden: false },
| { label: '电话类型', name: 'LineType', labtype: 'combox', hidden: false, data: JSON.parse(LineType) },
| { label: '来电单位', name: 'OrderId', labtype: 'txt', hidden: false },
| { label: '电话号码', name: 'Phone', labtype: 'txt', hidden: false },
| { label: '通话内容', name: 'Context', labtype: 'txt', hidden: false },
| { label: '合作意向', name: 'Intention', labtype: 'combox', hidden: false, data: JSON.parse(Intention)/*,cwidth: '5%', cccwidth: '28%' */ },
| { label: '接电话人', name: 'UserId', labtype: 'txt', hidden: false }
|
| ];
|
| var _pageAdd = function () {
| OpenWindow("新增通记录", "98%", "90%", "/DailyManagement/EditHoldPhone/?id=0");
| }
|
|
|
| function edit(id) {
| OpenWindow("修改通话记录", "600px", "700px", "/DailyManagement/EditHoldPhone/?id=" + id);
| }
|
| function del(id) {
| $.ajax({
| type: "POST",
| url: "/DailyManagement/ModifyStatus/?id=" + id,
| dataType: "json",
| global: false,
| async: false,
| data: $('form').serializeArray(),
| success: function (data) {
|
|
| if (data.Result) {
| parent.layer.msg('删除成功', { icon: 6 });
|
| }
| else {
| parent.layer.msg(data.Message, { icon: 5 });
| }
|
| },
| error: function () {
|
| parent.layer.msg('失败', { icon: 5 });
| }
| });
| }
|
| var _afterSave = function (result) {
| if (result) {
| toastr.success("保存成功");
| } else {
| toastr.error("保存失败");
| }
|
| }
|
| var _afterDel = function (result) {
| if (result) {
| toastr.success("删除成功");
| } else {
| /**/
| toastr.error("删除成功");
| /**/
| }
| }
|
|
|
| </script>
| }
|
|