您现在的位置是:首页 >>LayuiLayui
layui搜索功能
zhang2021-07-22 14:22:03【Layui】人已围观
简介:
Fun文件和List文件修改Fun文件需要修改:用于搜索的参数,状态改为“both”,下面需要加上: if not isnul(UserID) then whereStr = whereStr&...
Fun文件和List文件修改
Fun文件需要修改:
用于搜索的参数,状态改为“both”,
下面需要加上:
if not isnul(UserID) then whereStr = whereStr&" and UserID = '"&UserID&"'"
if not isnul(UserLevel) then whereStr = whereStr&" and UserLevel = '"&UserLevel&"'"
if not isnul(FollowStatus) then whereStr = whereStr&" and FollowStatus = '"&FollowStatus&"'"
if not isnul(ItemType) then whereStr = whereStr&" and ItemType = '"&ItemType&"'"
if not isnul(SourceType) then whereStr = whereStr&" and SourceType = '"&SourceType&"'"
需要用到的搜索参数,这里都需要一一配置。
List文件修改:
在class=“toolbarsearch”下面把需要搜索的项目代码添加好
<div class="toolbarsearch">
<span>负责人</span>
<select name="UserID" lay-search="">
<option value=''>所有</option>
<%getUserSelect "销售",UserID%>
</select>
<span>意向等级</span>
<select name="UserLevel">
<option value="">全部</option>
<%=GetSelect(replaceStr(sel_UserLevel,"",""),"")%>
</select>
<span>跟进状态</span>
<select name="FollowStatus">
<option value="">全部</option>
<%=GetSelect(replaceStr(sel_FollowStatus,"",""),"")%>
</select>
<span>项目类型</span>
<select name="ItemType">
<option value="">全部</option>
<%=GetSelect(replaceStr(sel_ItemType,"",""),"")%>
</select>
<span>客户来源</span>
<select name="SourceType">
<option value="">全部</option>
<%=GetSelect(replaceStr(sel_SourceType,"",""),"")%>
</select>
<select name="s_field">
<option value="">模糊搜索</option>
<option value="TrueName">客户姓名</option>
<option value="Mobile">手机号</option>
<option value="Weixin">微信号</option>
</select>
<input type="text" name="s_keyword" value="" placeholder="搜索关键词" autocomplete="off" class="layui-input keys">
<button id="submitbtn" class="layui-btn layuiadmin-btn-list layui-btn-sm" lay-submit lay-filter="LAY-app-contlist-search">搜索</button>
<button id="submitbtn" class="layui-btn layuiadmin-btn-list layui-btn-sm" onclick="window.location.href='?';">全部</button>
</div>
然后下面的监听搜索里面有四处需要同步修改,
只要用到的参数, 这四处横线处都要添加一遍,即一个参数要出现四次。
上一篇:layui下拉选择项
相关文章
随机图文
文章评论
评论加载中...
|