-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideoSearch.js
More file actions
245 lines (241 loc) · 9.03 KB
/
Copy pathvideoSearch.js
File metadata and controls
245 lines (241 loc) · 9.03 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
$(function () {
$(document).bind("contextmenu",function(e) {
return false;
});
$("#myModal").load("modal.html");
//屏幕适应
window.onresize = function(){
if($(document).width() <= 800){
$("#confirm").css({"width":"80%"});
$("#confirm button").css({"width":"40%"});
}else {
$("#confirm").css({"width":"48%"});
$("#confirm button").css({"width":"45%"});
}
}
$("tr").eq(0).css("background","#98D9DB");
$(".backPrev").click(function () {
window.location.href = "home.html";
});
$(".backSearch").click(function () {
info.search("1");
});
$("#beginDate").keyup(function () {
this.value=this.value.replace(/\s+/g,'');
});
$("#endDate").keyup(function () {
this.value=this.value.replace(/\s+/g,'');
});
//业务类型改变,刷新对应产品列表
$("#business").change(function () {
$.ajax({
url: "/easyRecordHS/business/findProductListByBusinessId",
data: JSON.stringify({
"businessTypeCode": this.value,
}),
contentType: "application/json;",
type: "post",
success: function (datas) {
if (datas.success) {
condition.productType = datas.result;
}
}
})
});
init();
})
//日历控件清除按钮调用事件
function clearDate() {
if($("#endDate").val()==""){
startDate.config.max.year = '2099';
startDate.config.max.month = '12';
startDate.config.max.date = '31';
}else{
endDate.config.min.year = '';
endDate.config.min.month = '';
endDate.config.min.date = '';
}
}
var startDate;
var endDate;
function init() {
//日期范围限制,控制开始时间和结束时间不能有冲突
startDate = laydate.render({
elem: '#beginDate',
done: function (value, date) {
if (value !== '') {
startDate.config.min.year = date.year;
startDate.config.min.month = date.month - 1;
startDate.config.min.date = date.date;
} else {
startDate.config.min.year = '';
startDate.config.min.month = '';
startDate.config.min.date = '';
}
}
});
endDate = laydate.render({
elem: '#endDate',
done: function (value, date) {
if (value !== '') {
endDate.config.max.year = date.year;
endDate.config.max.month = date.month - 1;
endDate.config.max.date = date.date;
} else {
endDate.config.max.year = '';
endDate.config.max.month = '';
endDate.config.max.date = '';
}
}
})
//初始化加载业务类型
$.ajax({
url: "/easyRecordHS/business/findBusinessList",
contentType: "application/json;",
type: "post",
success: function (result) {
if (result.success == true) {
condition.businessType = result.result;
}
}
});
//初始化加载状态类型
$.ajax({
url: "/easyRecordHS/business/findCodeType",
contentType: "application/json;",
type: "post",
success: function (result) {
if (result.success) {
console.log(JSON.stringify(result.result));
condition.interactiveType = result.result;
}
}
});
//页面加载时默认获取最近的5条记录
info.search();
}
var condition = new Vue({
el: ".videoSearchTop",
data: {
condition: {
appId: "",
agentCode: "",
interactive: "",
businessTypeCode: "",
productName: "",
productCode: "",
beginDate: "",
endDate: "",
busiNum: "",
page: "1"
},
businessType: [],
productType: [],
interactiveType: []
}, methods: {
checkAppId:function (e) {
var obj = e.currentTarget;
obj.value=obj.value.replace(/[^u4e00-u9fa5]/g,'');
condition.condition.appId=obj.value;
},checkAgentCode:function (e) {
var obj = e.currentTarget;
obj.value=obj.value.replace(/[^u4e00-u9fa5]/g,'');
condition.condition.agentCode=obj.value;
},checkProductCode:function (e) {
var obj = e.currentTarget;
obj.value=obj.value.replace(/[^u4e00-u9fa5]/g,'');
condition.condition.productCode=obj.value;
},checkBusiNum:function (e) {
var obj = e.currentTarget;
obj.value=obj.value.replace(/[^u4e00-u9fa5]/g,'');
condition.condition.busiNum=obj.value;
}
}
});
var info = new Vue({
el: ".tableBox",
data: {
currentPage:"1",
videoList: []
},
methods: {
contInfo: function (e) {
var obj = e.currentTarget;
var interactive=$(obj).find(".interactive").html();
if(interactive!="S" && interactive!="L" ){
return;
}
//查询保单创建人是否和登录是否一致,不一致不能进详情页面
sino.setCuccrentUser();
var agentCode = $(obj).find(".agentCode").html();
console.log(G.agentCode+","+agentCode);
if(G.agentCode!=agentCode){
return;
}
var contNo = $(obj).find(".contNo").html();
window.location = "detail.html?contNo=" + base64.encode(contNo);
}, search: function (currPage) {
condition.condition.beginDate = $("#beginDate").val();
condition.condition.endDate = $("#endDate").val();
if(currPage=="1"){
this.currentPage ="1";
condition.condition.page="1";
}
//根据条件获取数据
$.ajax({
url: "/easyRecordHS/video/findVideView",
contentType: "application/json;",
type: "post",
data: JSON.stringify(condition.condition),
async:false,
success: function (datas) {
if (datas.success) {
info.videoList = datas.data.contInfo;
// info.$nextTick(function () {
// $("tr:odd").css("background","#D0A791");
// $("tr:even").gt(0).css("background","#197DF6");
// })
if (datas.data.pages > 0) {
var numberOfPages=10;
if(datas.data.pages<10){
numberOfPages=datas.data.pages;
}
$('#page').show();
//初始化分页
var element = $('#page');
var options = {
bootstrapMajorVersion: 3, //bootstrap的版本要求
alignment: "right",
currentPage: info.currentPage, //设置当前页
numberOfPages: numberOfPages, //设置可以点击到的页数范围
totalPages: datas.data.pages, //设置总页数
itemTexts: function (type, page, current) {
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page;
}
},//点击事件,用于通过Ajax来刷新整个list列表
onPageClicked: function (event, originalEvent, type, page) {
condition.condition.page = page + "";
info.search("n");
info.currentPage=page;
}
}
element.bootstrapPaginator(options);
}else{
$('#page').hide();
}
}
}
})
}
}
});