easyui-combobox三级联动

<tr height="40">
	<td class="value" width="10%"><label class="Validform_label">所在单位/公司<br>(必填):</label></td>
	<td class="txt_value" width="20%">
		<input class="easyui-combotree" style="width:190px;height:28px;"
			data-options="editable:true,prompt:'请选择',url:'<%=path%>/client/treeList',method:'get',required:true,panelHeight:'300',onBeforeSelect:function(node){checkLeaf(node);},onSelect:function(node){initClient(node);}"/>
		<input type="hidden" id="c_org" name="workTask.client_org"/>
	</td>
	<td class="value" width="10%"><label class="Validform_label">申请人姓名:</label></td>
	<td class="txt_value" width="20%"><input type="text" id="c_name" name="workTask.client_name" style="width:190px;height:28px;"
		class="easyui-textbox" /><span></span></td>
	<td class="value" width="10%"><label class="Validform_label">联系电话:</label></td>
	<td class="txt_value" width="20%"><input type="text" id="c_tel" name="workTask.client_tel" style="width:190px;height:28px;"
		class="easyui-textbox"/><span></span></td>
</tr>
<tr height="40">
	<td class="value" width="10%"><label class="Validform_label">选择对应合同:</label></td>
	<td class="txt_value" width="20%">
		<select class="easyui-combobox" style="width:190px;height:28px;" 
		id="contract" name="workTask.contract_id" data-options="valueField:'ID',textField:'NAME', onSelect: function(node){initService(node);}">
		</select>
	<span></span></td>
	<td class="value" width="10%"><label class="Validform_label">服务范围:</label></td>
	<td class="txt_value" width="20%" colspan="3">
		<select class="easyui-combobox" style="width:190px;height:28px;" id="service" name="workTask.service_id" data-options="valueField:'ID',textField:'NAME'">
		</select>
	<span></span></td>
</tr>
//点击后获取联系人信息
function initClient(node){
	if(node.id){
		$('#c_name').textbox('setValue', node.attributes.contacts);
		$('#c_tel').textbox('setValue', node.attributes.tel);
		$('#c_qq').textbox('setValue', node.attributes.qq);
		$('#c_org').val(node.text);
		// 选择具体单位后,获取该单位下的所有合同
		var org_name = node.text;
		var url = "<%=path%>/contract/getContractListByOrgName?name="+org_name;
		$("#contract").combobox('reload',url);
		<%-- $.ajax({
			url:"<%=path%>/contract/getContractListByOrgName?name="+org_name,
			type:'post',
			dataType:'json',
			success:function(data){
				if(data.result=='0'){
					console.log(data.data);
					$("#contract").append(data.data);
				}else{
					alert("你选择的单位还没有合同,请添加该单位的合同后再派发工单");
				}
			},
			error:function(res){
				
			}
		}); --%>
	}
}

// 点击合同,加载服务范围
function initService(node){
	var service_id = node.ID;
	console.log("service_id="+service_id);
	var url = "<%=path%>/contract/getServiceListByContractId?id="+service_id;
	$("#service").combobox('reload',url);
}

页面效果,涉及到三个下拉框联动
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黄宝康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值