customerAddExist.jsp
5.98 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
<!DOCTYPE html>
<%@page import="weaver.crm.Maint.CustomerTypeComInfo"%>
<%@page import="weaver.general.Util"%>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.hrm.User"%>
<%@page import="weaver.systeminfo.SystemEnv"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
User user = HrmUserVarify.checkUser(request, response);
if(user == null){
out.println("无用户,请登录");
return;
}
int language = user.getLanguage();
CustomerTypeComInfo comInfo = new CustomerTypeComInfo();
String value = "";
String text = "";
if(comInfo.next()){
value = comInfo.getCustomerTypeid();
text = Util.formatMultiLang(comInfo.getCustomerTypename(),language+"");
}
%>
<html>
<head>
<title><%=SystemEnv.getHtmlLabelName(15006,language)%>-<%=SystemEnv.getHtmlLabelName(387355,language)%></title>
</head>
<body>
<div id="crm_cust_add_exist" class="page out">
<style type="text/css">
#crm_cust_add_exist ul.list{overflow: auto; -webkit-overflow-scrolling: touch;}
#crm_cust_add_exist ul.list li{padding:0px;}
#crm_cust_add_exist ul.list li > a{padding: 10px 0px;}
#crm_cust_add_exist ul.list .manager{float: right;font-size:12px;margin-right:3px;}
#crm_cust_add_exist ul.list .cust-name{color:#333;font-size:14px;}
#crm_cust_add_exist .search-result{visibility: hidden;}
</style>
<div class="header" data-role="header">
<div class="left" onclick="javascript:history.go(-1);"><%=SystemEnv.getHtmlLabelName(15006,language)%></div>
<div class="right searchBtn"><%=SystemEnv.getHtmlLabelName(387355,language)%></div>
</div>
<div class="content">
<div class="form_msg" style="top:140px;"></div>
<form disabledEnterSubmit>
<div class="field" data-flag="type">
<div><%=SystemEnv.getHtmlLabelName(63,language)%> :</div>
<div>
<a href="/mobile/plugin/crm_new/crmType.jsp" data-formdata="callback=CRM.setCrmAddExistPageType" class="more">
<div class="text"></div>
<input name="type" type="text" style="display: none;"/>
<div class="tip"><%=SystemEnv.getHtmlLabelName(391136,language)%></div>
</a>
<div class="clear-btn" style="display:none;"></div>
</div>
</div>
<div class="field">
<div><%=SystemEnv.getHtmlLabelName(195,language)%> :</div>
<div>
<input placeholder="<%=SystemEnv.getHtmlLabelNames("1268",language)%>" type="text" name="name"/>
</div>
</div>
</form>
<ul style="list-style: none;padding:15px;margin: 0px;">
<li style="font-size: 12px;color:#666;"><%=SystemEnv.getHtmlLabelName(20272,language)%></li>
<li style="font-size: 12px;color:#666;"><%=SystemEnv.getHtmlLabelName(20273,language)%></li>
</ul>
<div class="search-result">
<div class="controlTitle" style="font-size: 12px;padding-top: 8px;"><%=SystemEnv.getHtmlLabelName(388628,language)%>" <span>mm</span> "<%=SystemEnv.getHtmlLabelName(388629,language)%>:</div>
<ul class="list"></ul>
</div>
</div>
<script type="text/javascript">
$.extend(CRM, {
buildCrmAddExistPage : function(){
var that = this;
var $crm_custAddExist = $("#crm_cust_add_exist");
$(".clear-btn", $crm_custAddExist).click(function(){
var $field = $(this).parents(".field[data-flag]");
if($field.length > 0){
var flag = $field.attr("data-flag");
that.setCrmAddExistFieldValue("", "", flag);
}
});
var $list = $("ul.list", $crm_custAddExist);
var t = $list.offset().top-45;
$list.css({
"position": "absolute",
"left": "0px",
"right": "0px",
"bottom": "0px",
"top": t + "px"
});
var $search_result = $(".search-result", $crm_custAddExist);
$search_result.hide();
$search_result.css("visibility","visible");
$(".header .searchBtn", $crm_custAddExist).click(function(){
$search_result.hide();
$list.find("*").remove();
var $form_msg = $(".form_msg", $crm_custAddExist);
var $form = $("form", $crm_custAddExist);
var $name = $("input[name='name']", $form);
var name = $name.val();
if($.trim(name) == ""){
$form_msg.html("<%=SystemEnv.getHtmlLabelNames("1268,18622",language)%>");
$form_msg.show();
//$name[0].focus();
setTimeout(function(){$form_msg.hide();}, 1500);
return;
}
$form_msg.html("<%=SystemEnv.getHtmlLabelName(126719,language)%>...");
$form_msg.show();
that.ajax("/mobile/plugin/crm_new/crmAction.jsp?action=getExistCrm", $form.serialize(), function(result){
$form_msg.hide();
var type = $("input[name='type']", $form).val();
var crms = result.crms;
if(crms.length > 0){
$(".header", $crm_custAddExist).append("<div class=\"right goBtn\" style=\"right:50px;\"><%=SystemEnv.getHtmlLabelName(1256,language)%></div>");
$(".header .goBtn", $crm_custAddExist).click(function(){
location.href = '#&/mobile/plugin/crm_new/customerAdd.jsp?name='+name+"&type="+type;
})
$(".controlTitle span",$search_result).html(name);
$.each(crms, function(i, cdata){
$list.append("<li><a href=\"/mobile/plugin/crm_new/customer.jsp?id="+cdata["id"]+"\"><div class=\"manager\">"+cdata["manager"]+"</div><div class=\"cust-name\">"+cdata["name"]+"</div></a></li>");
});
$search_result.show();
}else{
location.href = '#&/mobile/plugin/crm_new/customerAdd.jsp?name='+name+"&type="+type;
}
//重置form
//$form[0].reset();
//that.setCrmAddExistFieldValue("<%=value%>", "<%=text%>", "type");
});
});
that.setCrmAddExistFieldValue("<%=value%>", "<%=text%>", "type");
},
setCrmAddExistPageType : function(value, text){
var that = this;
that.setCrmAddExistFieldValue(value, text, "type");
},
setCrmAddExistFieldValue : function(value, text, flag){
var $field = $("#crm_cust_add_exist .field[data-flag='"+flag+"']");
var $realField = $("input[name='"+flag+"']", $field);
$realField.val(value);
if(value == ""){
$field.removeClass("hasValue");
}else{
$field.addClass("hasValue");
}
var $more = $(".more", $field);
if($more.length > 0){
$(".text", $more).html(text);
}
}
});
CRM.buildCrmAddExistPage();
</script>
</div>
</body>
</html>