|
@@ -151,18 +151,10 @@
|
|
|
var arr="${workClientInfo.clientType}".split(',');
|
|
|
$('#clientType').selectpicker('val',arr);
|
|
|
|
|
|
- $("#name").on("blur",function () {
|
|
|
+ //模糊查询
|
|
|
+ $("#name").on("keyup",function () {
|
|
|
var keyword = $(this).val();
|
|
|
- if (keyword != null && keyword != "") {
|
|
|
- $.getJSON(
|
|
|
- "${ctx}/workclientinfo/workClientInfo/enterpriseSearchByName",
|
|
|
- {"keyword": keyword},
|
|
|
- function (data) {
|
|
|
- console.log(data);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
+ fuzzyQuery(keyword);
|
|
|
});
|
|
|
});
|
|
|
function testOurBank(value){
|
|
@@ -277,6 +269,51 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 模糊查询下拉框
|
|
|
+ function fuzzyQuery(keyword){
|
|
|
+ if (!(keyword != null && "" !== keyword)) {
|
|
|
+ $("#fuzzyQuerySelect").hide();
|
|
|
+ } else {
|
|
|
+ $.post(
|
|
|
+ "${ctx}/workclientinfo/workClientInfo/enterpriseSearchByName",
|
|
|
+ {"keyword": keyword},
|
|
|
+ function (result) {
|
|
|
+ var json = eval(result.data.items);
|
|
|
+ var html = "<ul>";
|
|
|
+ // var html = "<table border='0' width='410px'>";
|
|
|
+ for (var i = 0; i < json.length; i++) {
|
|
|
+ html += "<li value=" + json[i].id + ">" + json[i].entname + "</li>";
|
|
|
+ }
|
|
|
+ html += "</ul>";
|
|
|
+ $("#fuzzyQuerySelect").show().html(html);
|
|
|
+
|
|
|
+ //鼠标移动到某行上改变颜色
|
|
|
+ $("li").bind("mouseover", function () {
|
|
|
+ $(this).css("background-color", "grey");
|
|
|
+ });
|
|
|
+ $("li").bind("mouseout", function () {
|
|
|
+ $(this).css("background-color", "white");
|
|
|
+ });
|
|
|
+ //单击某行
|
|
|
+ $("li").bind("click", function () {
|
|
|
+ $("#fuzzyQuerySelect").hide();
|
|
|
+ var id = $(this).val();
|
|
|
+ $.getJSON(
|
|
|
+ "${ctx}/workclientinfo/workClientInfo/enterpriseTicketInfo",
|
|
|
+ {"id": id},
|
|
|
+ function (data) {
|
|
|
+ console.log(data);
|
|
|
+ $("#name").val(data.ENTNAME);
|
|
|
+ $("#uscCode").val(data.UNCID);
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ });
|
|
|
+ }, "json");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
|
|
@@ -291,11 +328,14 @@
|
|
|
<form:hidden path="id"/>
|
|
|
<div class="form-group layui-row first">
|
|
|
<div class="form-group-label"><h2>基本信息</h2></div>
|
|
|
- <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <div class="layui-item layui-col-sm6 lw7" id="search">
|
|
|
<label class="layui-form-label"><span class="require-item">*</span>客户名称:</label>
|
|
|
<div class="layui-input-block">
|
|
|
<form:input path="name" htmlEscape="false" class="form-control required layui-input"/>
|
|
|
</div>
|
|
|
+ <div id="fuzzyQuerySelect"
|
|
|
+ style="display:none;background-color:white; position: relative; width:333px;left:120px; border: 1px solid gray;">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="layui-item layui-col-sm6 lw7">
|
|
|
<label class="layui-form-label double-line"><span class="require-item">*</span>拥有统一社会信用代码:</label>
|