userFeedback.js
3.2 KB
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
/**
* 会员体系
*/
var feedback = function() {
return {
search : function() {
$('#data-grid').datagrid({
url : '/user/feedback/search',
queryParams : App.dataGridQueryParams('search-form')
});
},
formatterFeedback : function(value, row, index) {
var status;
switch (value) {
case '0':
status = '有效';
break;
case '1':
status = '无效';
break;
}
return status;
},
formatterStatus : function(value, row, index) {
var status;
switch (value) {
case '0':
status = '未回访';
break;
case '1':
status = '已回访';
break;
}
return status;
},
formatterContent : function(value, row, index) {
var content = value;
if(content.length>10){
var content = value.substring(0,10)+"......"
}
return content;
},
/** 关闭弹窗时候重置页面 */
clearDialog : function() {
// 清空表单
$("#otcCode").textbox("readonly",false);
$("#add-form").form("clear");
},
beforeFeedback : function() {
var row = $("#data-grid").datagrid("getSelected");
if (row) {
$("#feedContent").css("display", "");
$("#content-form").form("load", row);
$("#content-dialog").dialog("setTitle", "内容查看");
$("#content-dialog").dialog("open");
}else{
$.messager.alert("提示", "请选择操作数据");
}
},
upFeedback : function() {
var row = $("#data-grid").datagrid("getSelected");
if (row) {
$("#content-form").form("load", row);
$("#feedContent").css("display","none");
$("#content-dialog").dialog("setTitle", "设定反馈状态");
$("#content-dialog").dialog("open");
}else{
$.messager.alert("提示", "请选择操作数据");
}
},
feedbackUpdate : function() {
$("#content-form").form('submit', {
url : "/user/feedback/upFeedbackStatus",
onSubmit : function(param) {
return $(this).form('validate');
},
success : function(data) {
if (data == 1) {
$.messager.show({
title : '信息',
msg : '反馈成功'
});
$('#data-grid').datagrid('reload');
$("#content-dialog").dialog("close");
} else {
$.messager.alert("错误", "修改反馈失败");
}
}
});
},
upReturn : function() {
var row = $("#data-grid").datagrid("getSelected");
if (row) {
$("#return-form").form("load", row);
$("#return-dialog").dialog("setTitle", "回访");
$("#return-dialog").dialog("open");
}else{
$.messager.alert("提示", "请选择操作数据");
}
},
returnUpdate : function() {
if($("#remark").val().length>0){
$("#return-form").form('submit', {
url : "/user/feedback/upReturnStatus",
onSubmit : function(param) {
return $(this).form('validate');
},
success : function(data) {
if (data == 1) {
$.messager.show({
title : '信息',
msg : '回访成功'
});
$('#data-grid').datagrid('reload');
$("#return-dialog").dialog("close");
} else {
$.messager.alert("错误", "回访失败");
}
}
});
}else{
$.messager.alert("错误", "回访备注不能为空");
}
},
closeContent : function(){
$("#content-dialog").dialog('close');
},
closeReturn : function(){
$("#return-dialog").dialog('close');
},
}
}();