前台界面

<fieldset>
<legend>查询</legend>
<table style="width: 100%;">
<tr>
<td class="tb1">区域:</td>
<td class="td2">
<input id="quyu" name="quyu" class="easyui-combobox" /></td>
<td class="tb1">行业:</td>
<td class="td2">
<input id="hangye" name="hangye" class="easyui-combobox" /></td>
<td class="tb1">客户名称:</td>
<td class="td2" colspan="2">
<input id="kehuming" name="kehumingcheng" class="easyui-textbox" style="width:300px;" /></td>
<td class="tb1" style="text-align:right;"><a id="btnchaxun" href="#" class="easyui-linkbutton" data-options="iconCls:‘icon-search‘">查询</a> </td>
</tr>
</table>
<div class="easyui-panel" title="高级搜索条件"
style="width: 100%; background: #fafafa;"
data-options="collapsible:true,collapsed:true">
<table style="width: 100%; padding-left: 5px;">
<tr>
<td class="tb1">省:</td>
<td class="td2">
<input id="sheng" class="easyui-combobox" ></td>
<td class="tb1">市:</td>
<td class="td2">
<input id="shi" name="shi" class="easyui-combobox" /></td>
<td class="tb1">产品属性:</td>
<td class="td2">
<input id="chanpinshuxing" name="chanpinshuxing" class="easyui-combobox" /></td>
<td class="tb1">物流模式:</td>
<td class="td2">
<input id="wuliumoshi" name="wuliumoshi" class="easyui-combobox" /></td>
<td></td>
</tr>
</table>
<table style="width: 100%;">
<tr>
<td style="width: 50px;"></td>
<td class="checkbox" style="display:none;">
<input type="checkbox" name="name" value="" />TOP客户</td>
<td class="checkbox">
<input type="checkbox" name="name" value="" id="CrmClient_IsTradeTop" />行业TOP</td>
<td class="checkbox">
<input type="checkbox" name="name" value="" id="CrmClient_IsCompanyTop" />公司TOP</td>
<td class="checkbox">
<input type="checkbox" name="name" value="" id="CrmClient_IsAreaTop"/>片区TOP</td>
<td class="checkbox">
<input type="checkbox" name="name" value="" id="CrmClient_IsProvinceTop"/>省级TOP</td>
<td>
<input type="checkbox" name="name" value="" id="CrmClient_IsTargetCustomer"/>目标客户</td>
</tr>
</table>
</div>
</fieldset>

<div style="height: 5px;"></div>
<table id="gridchaxunjieguo" class="easyui-datagrid" data-options="title:‘查询结果‘,rownumbers:true,pagination:true,fitColumns:true,singleSelect:true" style="width: 100%; height: 345px;">
<thead>
<tr>
<th data-options="field:‘ck‘,checkbox:true,hidden:true"></th>
<th data-options="field:‘CrmClient_IsMatched‘,width:40,align:‘center‘">匹配</th>
<th data-options="field:‘CrmClient_IsTargetCustomer‘,width:40,align:‘center‘">目标</th>
<th data-options="field:‘CrmClient_Name‘,width:220,align:‘center‘">公司</th>
<th data-options="field:‘CrmArea_Name‘,width:120,align:‘center‘">区域</th>
<th data-options="field:‘CrmTrade_Name‘,width:120,align:‘center‘">行业</th>
<th data-options="field:‘province‘,width:80,align:‘center‘">省</th>
<th data-options="field:‘city‘,width:80,align:‘center‘">市</th>
<th data-options="field:‘CrmClient_CreaterName‘,width:100,align:‘center‘">创建人</th>
<th data-options="field:‘CrmClient_CluesTime‘,align:‘center‘">线索获取时间</th>
<th data-options="field:‘CrmClient_CreatedDateTime‘,align:‘center‘">数据录入时间</th>
</tr>
</thead>
</table>
<table style="width: 100%;display:none;" id="createButtonPanel">
<tr>
<td></td>
<td style="width: 60px; text-align: right"><a id="btnAdd" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:‘icon-add‘">创建</a> </td>
<td style="width: 70px; padding-left: 25px; display:none;"><a id="btnCancel" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:‘icon-cancel‘">取消</a> </td>
</tr>
</table>

<!-- 修改界面 -->
<div id="dialog" class="easyui-dialog" title="修改客户线索" data-options="closed:true" style="padding:5px; top:5px;left:5px;">
<iframe id="changPage" src="" width="99%" height="99%" style="border:none;"></iframe>
</div>

<!-- 全局变量 -->
<script>
window["clientData"] = null;
</script>

<!-- 页面启动函数 -->
<script>
$(document).ready(function () {
//开启遮照
parent.showMask();

//根据 url 显示创建按钮,重新设置高度
initPageModel();

//绑定修改事件
initEditTrigger();

//初始化,客户名称智能搜索
initClientNameFuzzyQuery();

//行业
$.ajax({
url: "/Handler/GetTradeTypeHandler.ashx", //请求的url地址
dataType: "json", //返回格式为json
type: "post", //请求方式
success: function (req) {
//请求成功时处理
//去除遮照
var resultToParse = req["data"];
resultToParse.unshift({"CrmTrade_ID":"","CrmTrade_Name":"请选择"});
jQuery("#hangye").combobox({
valueField: ‘CrmTrade_ID‘,
textField: ‘CrmTrade_Name‘
}).combobox("loadData", resultToParse);
var data = $(‘#hangye‘).combobox(‘getData‘);//默认选中第一条
$("#hangye").combobox(‘select‘, data[0]["CrmTrade_ID"]);
},
error: function (a, b, c) {
//请求出错处理
//去除遮照
console.log(a);
}
});

//产品属性
$.ajax({
url: "/Handler/GetProductTypeHandler.ashx", //请求的url地址
dataType: "json", //返回格式为json
type: "post", //请求方式
success: function (req) {
//请求成功时处理
//去除遮照
var resultToParse = req["data"];
resultToParse.unshift({"CrmProductType_ID":"","CrmProductType_Name":"请选择"});
jQuery("#chanpinshuxing").combobox({
valueField: ‘CrmProductType_ID‘,
textField: ‘CrmProductType_Name‘
}).combobox("loadData", resultToParse);

var data = $(‘#chanpinshuxing‘).combobox(‘getData‘);//默认选中第一条
$("#chanpinshuxing").combobox(‘select‘, data[0]["CrmProductType_ID"]);
},
error: function (a, b, c) {
//请求出错处理
//去除遮照
console.log(a);

}
});
//物流模式
$.ajax({
url: "/Handler/GetLogisticsModelHandler.ashx", //请求的url地址
dataType: "json", //返回格式为json
type: "post", //请求方式
success: function (req) {
//请求成功时处理
//去除遮照
var resultToParse = req["data"];
resultToParse.unshift({"CrmLogisticsModel_ID":"","CrmLogisticsModel_Name":"请选择"});
jQuery("#wuliumoshi").combobox({
valueField: ‘CrmLogisticsModel_ID‘,
textField: ‘CrmLogisticsModel_Name‘
}).combobox("loadData", resultToParse);

var data = $(‘#wuliumoshi‘).combobox(‘getData‘);//默认选中第一条
$("#wuliumoshi").combobox(‘select‘, data[0]["CrmLogisticsModel_ID"]);

},
error: function (a, b, c) {
//请求出错处理
//去除遮照
console.log(a);
}
});

//获取省
$.ajax({
url: "/Handler/GetAddressHandler.ashx", //请求的url地址
dataType: "json", //返回格式为json
type: "post", //请求方式
success: function (req) {
//请求成功时处理
//去除遮照
var resultToParse = req["data"]["province"];
resultToParse.unshift({"CityCode":"","CityName":"请选择"});

jQuery("#sheng").combobox({
valueField: ‘CityCode‘,
textField: ‘CityName‘
}).combobox("loadData", resultToParse).combobox(‘select‘, ‘‘);

//绑定级联事件(省市)
$("#sheng").combobox({
"onSelect": function (record) {
var provinceCode = record["CityCode"];
//级联调整市级菜单
shijiTrigger(req["data"]["city"], provinceCode);
}
});
//初始化市
initCityCombox(req);

},
error: function (a, b, c) {
//请求出错处理
//去除遮照
console.log(a);
}
});

//初始化,绑定搜索按钮事件
jQuery("#btnchaxun").click(function () {
var searchCondition = getSearchCondition();
refreshClientList(searchCondition);
});

//初始化,绑定grid分页事件
$("#gridchaxunjieguo").datagrid("getPager").pagination({
onBeforeRefresh:function(){
//alert(‘before refresh‘);
},
onRefresh:function(pageNumber,pageSize){
//alert(pageNumber);
//alert(pageSize);
},
onChangePageSize:function(){
//alert(‘pagesize changed‘);
},
onSelectPage:function(pageNumber,pageSize){
//alert(pageNumber);
//alert(pageSize);
var searchCondition = getSearchCondition(pageNumber,pageSize);
refreshClientList(searchCondition);
}
});

//区域
$.ajax({
url: "/Handler/GetAreasHandler.ashx", //请求的url地址

dataType: "json", //返回格式为json
type: "post", //请求方式
success: function (req) {
//请求成功时处理
//去除遮照
var resultToParse = req["data"];
resultToParse.unshift({ "CrmArea_ID": "", "CrmArea_Name": "请选择" });
jQuery("#quyu").combobox({
valueField: ‘CrmArea_ID‘,
textField: ‘CrmArea_Name‘
}).combobox("loadData", resultToParse);
var data = $(‘#quyu‘).combobox(‘getData‘);//默认选中第一条
$("#quyu").combobox(‘select‘, data[0]["CrmArea_ID"]);
parent.hideMask();
},
error: function (a, b, c) {
//请求出错处理
//去除遮照
console.log(a);
parent.hideMask();
}
});
doubleTrigger();//datagrid双击双击事件
});

</script>
<!--datagrid双击事件-->
<script>
function doubleTrigger() {
$("#gridchaxunjieguo").datagrid({
onDblClickRow: function (rowIndex, rowData) {
window["clientData"] = rowData;
jQuery("#changPage").attr("src", "/UI/CustomerInformation/CustomerInformationHandUpdate.aspx?t=read");

//显示编辑界面
$("#dialog").dialog({
width: $("#content", parent.document).width() - 10,
height: $("#content", parent.document).height() - 10,
}).dialog("open");
//$("#changPage").css({background:"#ffffff",position:"absolute",filter:"alpha(opacity=30)",opacity:0.5,width:"100%",height:"100%"});
//jQuery(‘iframe‘).showLoading({ ‘addclass‘: ‘background:"#ffffff",position:"absolute",z-index:2,filter:"alpha(opacity=30)",opacity:0.5,width:"100%",height:"100%"‘ });
}
});
}
</script>
<!-- 初始化市combox -->
<script>
function initCityCombox(provinceAndCityData) {

//请求成功时处理
//去除遮照
var resultToParse = provinceAndCityData["data"]["city"];

//看懂就行 start
var jsonData = [];
var cityArray = resultToParse[0];
for (var key in cityArray) {
for (var key2 in cityArray[key][0]) {
var tempJsonItme = { "CityCode": key2, "CityName": cityArray[key][0][key2] };
jsonData.push(tempJsonItme);
}
}
//看懂就行 end

jsonData.unshift({"CityCode":"","CityName":"请选择"});

jQuery("#shi").combobox({
valueField: ‘CityCode‘,
textField: ‘CityName‘
}).combobox("loadData", jsonData).combobox(‘select‘, ‘‘);

}
</script>

<!-- 级联调整市级菜单 -->
<script>
function shijiTrigger(resultToParse, provinceCode) {
if(provinceCode == ‘‘)
{
jQuery("#shi").combobox({valueField: ‘CityCode‘,textField: ‘CityName‘}).combobox("loadData", [{"CityCode":"","CityName":"请选择"}]).combobox(‘select‘, ‘‘);
}

for (var i = 0; i < resultToParse.length; i++) {
for (var Pkey in resultToParse[i]) {
if (Pkey == provinceCode) {
var cityArray = resultToParse[i][Pkey];
var jsonData = [];
for (var key in cityArray) {
for (var key2 in cityArray[key]) {
var tempJsonItme = { "CityCode": key2, "CityName": cityArray[key][key2] };
jsonData.push(tempJsonItme);
}
}
jsonData.unshift({"CityCode":"","CityName":"请选择"});

jQuery("#shi").combobox({
valueField: ‘CityCode‘,
textField: ‘CityName‘
}).combobox("loadData", jsonData).combobox(‘select‘, ‘‘);
}
}
}

}
</script>

<!-- 搜索客户信息 -->
<script>
function refreshClientList(searchCondition)
{
//开启遮照
parent.showMask();
$.ajax({
type: "post",
url: "/Handler/SearchClientHandler.ashx",
dataType: "json",
data: {
"searchCondition":searchCondition
},
success: function (data) {
if (data[0]["result"] == "1") {
var dataArrayToAdd=data[0]["data"];

//格式化数据
for(var i=0;i<dataArrayToAdd.length;i++)
{
if(dataArrayToAdd[i]["CrmClient_IsMatched"]=="1")
{
dataArrayToAdd[i]["CrmClient_IsMatched"]="<img src=\"\\Images\\hook.png\" />";
}
else
{
dataArrayToAdd[i]["CrmClient_IsMatched"]=‘‘;
}
if(dataArrayToAdd[i]["CrmClient_IsTargetCustomer"]=="1")
{
dataArrayToAdd[i]["CrmClient_IsTargetCustomer"]="<img src=\"\\Images\\hook.png\" />";
}
else
{
dataArrayToAdd[i]["CrmClient_IsTargetCustomer"]=‘‘;
}
}

var totalRowCount =data[0]["total"];
var json={"total":totalRowCount,"rows":dataArrayToAdd};
$("#gridchaxunjieguo").datagrid("loadData",json);
parent.hideMask();
}
else
{
$(‘#gridchaxunjieguo‘).datagrid(‘loadData‘, { total: 0, rows: [] });
$("#gridchaxunjieguo").datagrid(‘getPager‘).data("pagination").options.pageNumber=1;
parent.hideMask();
}
}
});
}
</script>

<!-- 获取搜索条件数据 -->
<script>
function getSearchCondition(pageIndex,pageSize)
{
var result = {};
result["CrmClient_Name"] = $("#kehuming").combo("getText");
result["CrmArea_ID"]=$("#quyu").combobox(‘getValue‘);
result["CrmTrade_ID"]=$("#hangye").combobox(‘getValue‘);
result["CrmClient_ProvinceID"]=$("#sheng").combobox(‘getValue‘);
result["CrmClient_CityID"]=$("#shi").combobox(‘getValue‘);
result["CrmClient_ProductAttributesID"]=$("#chanpinshuxing").combobox(‘getValue‘);
result["CrmClient_LogisticsModeID"]=$("#wuliumoshi").combobox(‘getValue‘);
result["CrmClient_IsTradeTop"]=$("#CrmClient_IsTradeTop").get(0).checked==true?1:-1;
result["CrmClient_IsCompanyTop"]=$("#CrmClient_IsCompanyTop").get(0).checked==true?1:-1;
result["CrmClient_IsAreaTop"]=$("#CrmClient_IsAreaTop").get(0).checked==true?1:-1;
result["CrmClient_IsProvinceTop"]=$("#CrmClient_IsProvinceTop").get(0).checked==true?1:-1;
result["CrmClient_IsTargetCustomer"]=$("#CrmClient_IsTargetCustomer").get(0).checked==true?1:-1;
result["pageIndex"]=$("#gridchaxunjieguo").datagrid(‘getPager‘).data("pagination").options.pageNumber;
result["pageSize"]=$("#gridchaxunjieguo").datagrid(‘getPager‘).data("pagination").options.pageSize;
//alert(result["pageIndex"]+"^"+result["pageSize"]);
if(pageIndex!=undefined)
{
result["pageIndex"]=pageIndex;
}
if(pageSize!=undefined)
{
result["pageSize"]=pageSize;
}
return result;
}
</script>

<!-- 获取客户名称列表 -->
<script>
function initClientNameFuzzyQuery()
{
$(‘#kehuming‘).combobox({
prompt: ‘智能查询公司名,输入后请空格‘,
required: false,
mode: ‘remote‘,
url: ‘/Handler/GetCompanyName.ashx‘,
editable: true,
valueField: ‘companyName‘,
textField:‘companyName‘,
hasDownArrow: false,
onBeforeLoad: function (param) {
if (param == null || param.q == null || param.q.replace(/ /g, ‘‘) == ‘‘) {
var value = $(this).combobox(‘getValue‘);
if (value) {// 修改的时候才会出现q为空而value不为空
param.id = value;
return true;
}
return false;
}
}
});
}
</script>

<!-- 根据 url 设置界面 -->
<script>
function initPageModel()
{
var fileName = window.location.pathname;

if (fileName == "/UI/CustomerInformation/CustomerInformationSearch.aspx")
{
//客户搜索界面
jQuery("#createButtonPanel").hide();
}
if (fileName == "/UI/CustomerInformation/CustomerInformationUpdate.aspx")
{
//客户修改界面
jQuery("#btnAdd span").find(".l-btn-text").text("修改");
jQuery("#btnAdd span:last").removeClass("icon-add").addClass("icon-edit");
jQuery("#createButtonPanel").show();
}
}
</script>

<!-- 绑定修改事件 -->
<script>
function initEditTrigger()
{
jQuery("#btnAdd").click(function () {
var selectedRow = jQuery("#gridchaxunjieguo").datagrid("getSelected");
if (selectedRow != null) {
window["clientData"] = selectedRow;

jQuery("#changPage").attr("src", "/UI/CustomerInformation/CustomerInformationHandUpdate.aspx");

//显示编辑界面
$("#dialog").dialog({
width: $("#content", parent.document).width() - 10,
height: $("#content", parent.document).height() - 10,
}).dialog("open");
}
else {
//显示提示信息
$.messager.show({
title: ‘提示‘,
msg: ‘请先选择一行数据‘,
timeout: 1500,
showType: ‘slide‘
});
}
});
}
</script>

<!-- 刷新数据 -->
<script>
function getConditionAndRefreshData()
{
var pageopt = $(‘#gridchaxunjieguo‘).datagrid(‘getPager‘).data("pagination").options;
var pageNumber = pageopt.pageNumber;
var pageSize = pageopt.pageSize;
var searchCondition = getSearchCondition(pageNumber, pageSize);
refreshClientList(searchCondition);
}
</script>

<!-- 关闭对话框 -->
<script>
function closeDialog(flag)
{
jQuery("#dialog").dialog(‘close‘);
if (flag == 1)
{
jQuery.messager.show({
title: ‘‘,
msg: ‘修改成功!‘,
timeout: 200,
showType: ‘slide‘
});
}
}
</script>
<!--提示信息-->
<script>
function messageShow(message) {
//显示提示信息
$.messager.show({
title: ‘提示‘,
msg: message,
timeout: 1500,
showType: ‘slide‘
});
}
</script>

时间: 2024-07-29 15:38:50

前台界面的相关文章

前台界面2

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerInformationHandUpdate.aspx.cs" Inherits="CRM.UI.CustomerInformationHandUpdate" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/

关于easyui表格中从后台查询到的结果怎么显示到前台界面问题

首先要知道,easyui表格从后台接收的数据格式一定是json格式. 将查询出的结果以键值对的形式存入map集合中,最后将map集合转为json串在用字符流打印出来即可.前提要引入第三方架包 部分代码如下: //easyui表格从后台接收的数据格式一定是json格式 Map<String,Object> map = new HashMap<String, Object>(); map.put("rows",分页查询的结果集合); //注意这里的total是所有数

前台界面(3)--- 字符串和数组

目录 1. 字符串 1.1. 字符串中的转义序列 1.2. 字符串的不可变性 1.3. 字符串索引 1.4. 字符串分割:split 1.5. 数组连接成字符串:join 2. 数组 2.1. 数组索引 2.2. 多维数组 2.3. 数组方法 2.3.1. 数据追加到数组的尾部push() 函数 2.3.2. 移除数组最后一个元素pop() 函数 2.3.3. 移出数组第一个元素shift()函数 2.3.4. 加入到数组头部一个元素unshift()函数 2.3.5. 迭代数组:map 2.3

MVC的前台界面中冒号与等号的区别

View代码中:冒号和等号的区别:冒号后面的内容是经过Encode编码后输出内容等号后面是直接输出内容所以相对来说:后面更安全一些<%:Html.DropDownList("MyStyle)%>-----><span>111</span><%=Html.DropDownList("MyStyle)%>------->111

后台action处理数据传递给前台界面

package com.renmai.util; import java.io.IOException; import javax.servlet.http.HttpServletResponse; public class ResponseUtil { public static void writeGBK(HttpServletResponse response,String content) { response.setContentType("text/html;charset=GBK&

前台界面(1)---HTML基本定义及常见标签

已经很久没有更新博客了,从今天开始要继续走在学习的路上,话不多说,先来干货: 目录 1. HTML定义 2. H标签 3. Img标签 4. P标签 5. A标签 6. 无序列表 7. 有序列表 8. Form表单 9. Text input文本输入框 10. Button submit提交按钮 11. 单选按钮 12. 复选按钮 13. Div标签 -------------------------------------------黄金分割线-------------------------

模拟项目一(2)&amp;前台界面的理解和分析

<table id="tb" border="0" cellspacing="0" cellpadding="0" width="100%"> <ec:table items="resultList" autoIncludeParameters="${empty param.autoInc}" var="tdeSTU" actio

ASP.Net 打通服务器代码和前台界面的特殊符号

1.<% %>用来绑定后台代码 如: < % for(int i=0;i<100;i++) { Reaponse.Write(i.ToString()); } %> 2.<%# %> 是在绑定控件DataBind()方法执行时被执行,用于数据绑定 如: < %# Container.DataItem("title") %> 3.<%= %>用来绑定后台的变量或方法且有返回值 的,但此时的变量名或方法的访问修饰符为prot

用js在前台界面进行账户密码的检测,账户和密码符合要求后可进行登录

1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+requ