easyUI定区关联快递员js代码:

        <script type="text/javascript">
$.fn.serializeJson=function(){
var serializeObj={};
var array=this.serializeArray();
var str=this.serialize();
$(array).each(function(){
if(serializeObj[this.name]){
if($.isArray(serializeObj[this.name])){
serializeObj[this.name].push(this.value);
}else{
serializeObj[this.name]=[serializeObj[this.name],this.value];
}
}else{
serializeObj[this.name]=this.value;
}
});
return serializeObj;
}; function doAdd(){
$('#addWindow').window("open");
} function doEdit(){
alert("修改...");
} function doDelete(){
alert("删除...");
} function doSearch(){
$('#searchWindow').window("open");
} // 关联客户窗口弹出
function doAssociationCustomers(){
// 判定用户是否只选择了一个定区
var rows = $("#grid").datagrid('getSelections');
// 只选择了一行
if(rows.length == 1){
// 将选中定区id,设置到form的隐藏域
$("#customerFixedAreaId").val(rows[0].id); // 显示进度条
$.messager.progress({
interval :500 // 每0.5秒加载10%, 5秒加载完
}); // 发起Ajax请求
$.post("../../fixedArea_findNoAssociationCustomers.action", function(data){
// 查询所有 未关联定区客户列表
$(data).each(function(){
// 清空列表
$("#noassociationSelect").empty();
var option = $("<option value='"+this.id+"'>"+this.username+"("+this.address+")</option>");
$("#noassociationSelect").append(option);
}); // 请求结束后,关闭进度条
$.messager.progress('close');
// 弹出关联窗口
$('#customerWindow').window('open');
});
$.post("../../fixedArea_findHasAssociationFixedAreaCustomers.action",{"id":rows[0].id} , function(data){
// 查询所有 关联当前选中定区客户列表
$(data).each(function(){
// 清空列表
$("#associationSelect").empty();
var option = $("<option value='"+this.id+"'>"+this.username+"("+this.address+")</option>");
$("#associationSelect").append(option);
});
}); }else{
// 没有选 或者 选了多个定区
$.messager.alert('警告','定区关联客户必须(只能)选择一个定区','warning');
}
} //工具栏
var toolbar = [ {
id : 'button-search',
text : '查询',
iconCls : 'icon-search',
handler : doSearch
}, {
id : 'button-add',
text : '增加',
iconCls : 'icon-add',
handler : doAdd
}, {
id : 'button-edit',
text : '修改',
iconCls : 'icon-edit',
handler : doEdit
},{
id : 'button-delete',
text : '删除',
iconCls : 'icon-cancel',
handler : doDelete
},{
id : 'button-association-customer',
text : '关联客户',
iconCls : 'icon-sum',
handler : doAssociationCustomers
},{
id : 'button-association-courier',
text : '关联快递员',
iconCls : 'icon-sum',
handler : function(){
// 判断是否已经选中了一个定区,弹出关联快递员窗口
var rows = $("#grid").datagrid('getSelections');
if(rows.length==1){
// 只选择了一个定区
// 弹出定区关联快递员 窗口
$("#courierWindow").window('open');
// 保存选中定区id 到表单隐藏域
$("#courierFixedAreaId").val(rows[0].id);
}else{
// 没有选中定区,或者选择 了多个定区
$.messager.alert("警告","关联快递员,只能(必须)选择一个定区","warning");
}
}
}];
// 定义列
var columns = [ [ {
field : 'id',
title : '编号',
width : 80,
align : 'center',
checkbox:true
},{
field : 'fixedAreaNum',
title : '定区编号',
width : 120,
align : 'center',
formatter : function(value,row,index){
return row.id ;
}
},{
field : 'fixedAreaName',
title : '定区名称',
width : 120,
align : 'center'
}, {
field : 'fixedAreaLeader',
title : '负责人',
width : 120,
align : 'center'
}, {
field : 'telephone',
title : '联系电话',
width : 120,
align : 'center'
}, {
field : 'company',
title : '所属公司',
width : 120,
align : 'center'
} ] ]; $(function(){
// 先将body隐藏,再显示,不会出现页面刷新效果
$("body").css({visibility:"visible"}); // 定区数据表格
$('#grid').datagrid( {
iconCls : 'icon-forward',
fit : true,
border : true,
rownumbers : true,
striped : true,
pageList: [30,50,100],
pagination : true,
toolbar : toolbar,
url : "../../fixedArea_pageQuery.action",
idField : 'id',
columns : columns,
onDblClickRow : doDblClickRow
}); // 添加、修改定区
$('#addWindow').window({
title: '添加修改定区',
width: 600,
modal: true,
shadow: true,
closed: true,
height: 400,
resizable:false
}); // 查询定区
$('#searchWindow').window({
title: '查询定区',
width: 400,
modal: true,
shadow: true,
closed: true,
height: 400,
resizable:false
}); // 点击查询按钮,将form数据转换为json 绑定datagrid
$("#btn").click(function(){
// 转换form对象 到 json
var params = $("#searchForm").serializeJson();
// 绑定datagrid
$("#grid").datagrid('load',params);
// 关闭查询窗口
$("#searchWindow").window('close');
}); // 点击 添加定区的保存按钮,实现添加定区
$("#save").click(function(){
// 先校验表单
if($("#fixedAreaForm").form('validate')){
$("#fixedAreaForm").submit();
}else{
// 提示用户
$.messager.alert("警告","表单存在非法数据项!","warning");
}
}); // 向右移动按钮
$("#toRight").click(function(){
$("#associationSelect").append($("#noassociationSelect option:selected"));
}); // 向左移动按钮
$("#toLeft").click(function(){
$("#noassociationSelect").append($("#associationSelect option:selected"));
}); // 为关联客户按钮,添加click事件
$("#associationBtn").click(function(){
// 选中所有 已关联定区客户select中选项
$("#associationSelect option").attr("selected","selected");
// 提交表单
$("#customerForm").submit();
}); // 为关联快递员按钮,添加click事件
$("#associationCourierBtn").click(function(){
// 判断表单是否通过校验
if($("#courierForm").form('validate')){
$("#courierForm").submit();
}else{
$.messager.alert("警告","表单中存在非法数据","warning");
}
});
}); function doDblClickRow(){
alert("双击表格数据...");
$('#association_subarea').datagrid( {
fit : true,
border : true,
rownumbers : true,
striped : true,
url : "../../data/sub_area.json",
columns : [ [{
field : 'id',
title : '分拣编号',
width : 120,
align : 'center'
},{
field : 'province',
title : '省',
width : 120,
align : 'center',
formatter : function(data,row ,index){
if(row.area!=null){
return row.area.province;
}
return "";
}
}, {
field : 'city',
title : '市',
width : 120,
align : 'center',
formatter : function(data,row ,index){
if(row.area!=null){
return row.area.city;
}
return "";
}
}, {
field : 'district',
title : '区',
width : 120,
align : 'center',
formatter : function(data,row ,index){
if(row.area!=null){
return row.area.district;
}
return "";
}
}, {
field : 'addresskey',
title : '关键字',
width : 120,
align : 'center'
}, {
field : 'startnum',
title : '起始号',
width : 100,
align : 'center'
}, {
field : 'endnum',
title : '终止号',
width : 100,
align : 'center'
} , {
field : 'single',
title : '单双号',
width : 100,
align : 'center'
} , {
field : 'assistKeyWords',
title : '辅助关键字',
width : 100,
align : 'center'
} ] ]
});
$('#association_customer').datagrid( {
fit : true,
border : true,
rownumbers : true,
striped : true,
url : "../../data/association_customer.json",
columns : [[{
field : 'id',
title : '客户编号',
width : 120,
align : 'center'
},{
field : 'name',
title : '客户名称',
width : 120,
align : 'center'
}, {
field : 'company',
title : '所属单位',
width : 120,
align : 'center'
}]]
});
$('#association_courier').datagrid({
fit : true,
border : true,
rownumbers : true,
striped : true,
url : "../../data/courier.json",
columns : [[{
field : 'id',
title : '编号',
width : 120,
align : 'center'
},{
field : 'courierNum',
title : '快递员工号',
width : 120,
align : 'center'
},{
field : 'name',
title : '快递员姓名',
width : 120,
align : 'center'
}, {
field : 'standard.name',
title : '收派标准',
width : 120,
align : 'center',
formatter : function(value,row,index){
if(row.standard != null){
return row.standard.name;
}
return null ;
}
}, {
field : 'taketime.name',
title : '收派时间',
width : 120,
align : 'center',
formatter : function(value,row,index){
if(row.taketime != null){
return row.taketime.name;
}
return null ;
}
}, {
field : 'company',
title : '所属单位',
width : 120,
align : 'center'
}]]
});
}
</script>

easyUI定区关联快递员js代码的更多相关文章

  1. 项目一:第七天 CRM 和bos系统实现定区关联客户,关联快递员. 通过CXF框架实现

    定区关联客户 需求:为了快递方便客户下订单(发快递),派快递员上门取件.  所以说需要让定区关联客户(知道客户属于哪个定区),定区跟快递员关系:多对多.知道让哪个快递员上门取件. 将CRM系统中,客户 ...

  2. JAVAEE——BOS物流项目08:配置代理对象远程调用crm服务、查看定区中包含的分区、查看定区关联的客户

    1 学习计划 1.定区关联客户 n 完善CRM服务中的客户查询方法 n 在BOS项目中配置代理对象远程调用crm服务 n 调整定区关联客户页面 n 实现定区关联客户 2.查看定区中包含的分区 n 页面 ...

  3. BOS中定区关联客户

    1. 首先发布crm服务 第一步:创建动态的web项目crm,导入hessian的jar 第二步:创建一个crm数据库和t_customer表 第三步:在crm项目的web.xml中配置spring的 ...

  4. 原创:js代码, 让dedecms支持Tag选择, 添加内容更为方便,不用手输Tag

    dedecms在编辑修改内容时,TAG标签需要手动输,中文的Tag, 中间还得用半角字符','分隔,  输入法切来切去很不方便,   于是动手改后台代码, 利用后台的tags_main.php, 让d ...

  5. 一个基于 EasyUI 的前台架构(3)封装操作Tabs的JS代码

    一般来说,系统框架的主内容区会引入另一个独立的 Web 页面来实现系统的功能,所以在在 Tabs 里的每一个标签页里使用 iframe 标签来引入子页面.所以这里可以将 Tabs 的 Content ...

  6. 项目一:第五天 1、区域数据(pinyin4j-简码,城市编码) 2、Web层代码重构(model对象,分页代码提取) 3、区域分页查询 3、分区添加功能 4、定区管理管理-添加,分页

    Service: /** * @Description: 1.保存定区  2.让分区关联定区 * 对象三种状态 1.持久态(被session管理对象-一级缓存中有对象) 2.托管态(有OID标识,数据 ...

  7. jQuery Validate 表单验证插件----通过name属性来关联字段来验证,改变默认的提示信息,将校验规则写到 js 代码中

    一.下载依赖包 网盘下载:https://yunpan.cn/cryvgGGAQ3DSW  访问密码 f224 二. 添加一个另外一个插件jquery.validate.messages_cn.js. ...

  8. js下拉框二级关联菜单效果代码具体实现

    这篇文章介绍了js下拉框二级关联菜单效果代码具体实现,有需要的朋友可以参考一下 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transit ...

  9. 5行js代码搞定导航吸顶效果

    一.HTML布局 首先写HTML布局 <body> <div id="wrap"></div> </body> 二.CSS样式 给点 ...

随机推荐

  1. maven项目引入依赖之后,jar包没有自动导入报错

    解决这个问题可run maven-intall 一下 ,需要在联网的情况下去下载jar包. 我这样做了一下就可以了.

  2. Python中使用class(),面向对象有什么优势 转自知乎

    https://www.zhihu.com/question/19729316 首先我是辣鸡,然后这个问题的确有点意思 首先,类是一个集合,包含了数据,操作描述的一个抽象集合 你可以首先只把类当做一个 ...

  3. 有时间了解一下Spark SQL parser的解析器架构

    1:了解大体架构 2:了解流程以及各个类的职责 3:尝试编写一个

  4. GitHub 优秀的 Android 开源项目 (精品)

    1原文地址为 http://www.trinea.cn/android/android-open-source-projects-view/,作者Trinea Android开源项目系列汇总已完成,包 ...

  5. 从Linux内核角度看中间人攻击(ARP欺骗)并利用Python scapy实现

    邻居子系统与ARP协议 邻居子系统的作用就是将IP地址,转换为MAC地址,类似操作系统中的MMU(内存管理单元),将虚拟地址,转换为物理地址. 其中邻居子系统相当于地址解析协议(IPv4的ARP协议, ...

  6. HotSpot虚拟机对象探秘(对象创建,对象内存布局,对象访问定位)

    以常用的HotSpot虚拟机和JAVA内存区域堆为例,探讨对象的创建,对象的内存布局以及对象的访问定位 一.对象的创建 1)类加载:虚拟机遇到一条new指令时,先检测这个指令的参数能否在常量池中定位到 ...

  7. RabbitMQ详解(二)------消息通信的概念

    PS:近期在南宁出差,工作比较忙,所以更新会比较慢. 说到消息通信,可能我们首先会想到的是邮箱,QQ,微信,短信等等这些通信方式,这些通信方式都有发送者,接收者,还有一个中间存储离线消息的容器.但是这 ...

  8. AT1219 歴史の研究

    附带权值的类区间众数问题?不是很好策啊 发现题目没有强制在线,而且也只有询问操作,那么可以考虑莫队 但是这里的莫队有一个很显著的特征,插入的时候很好维护答案,但是删除的时候不好回退 那么有没有什么办法 ...

  9. Fiddler抓包和修改WebSocket数据,支持wss

    记录一下用Fiddler对WebSocket收发的数据进行抓包分析和篡改数据,只找到这么一个方法,能用就行吧. 时间:2019-3-29 环境: win7 + Fiddler 5.0 Fiddler抓 ...

  10. 深入浅出Tomcat/4 - Tomcat容器

    Container是一个Tomcat容器的接口,Tomcat有四种容器 ·     Engine ·     Host ·     Context ·     Wrapper Engine代表整个Ca ...