• 根据不同的产品id获得不同的下拉选项 (option传多值)


    <td> 没有 value

    所以要在<td>里面加上input  同时text 为hidden这样就不会显示value的值

    <td><select id='goodRefSuppliers_${s.index}' style=' 100px;'><option value=''>--请选择--</option>	
    			<c:forEach var='goodRefSuppliers' items='${goodRefSuppliersList}'>
    			 <c:if test ="${goodRefSuppliers.prdInfo == prd}">
    			 <option id='${goodRefSuppliers.suppliers.id}' value='${goodRefSuppliers.suppliers.name},${goodRefSuppliers.suppliers.id}'>${goodRefSuppliers.suppliers.name} 
    			 </option>
    			 </c:if>
    			 </c:forEach>
    			 </select>
    			 </td>
    			
    
    var chk_value = [];
    	function jqchk() { //jquery获取复选框值
    
    		$('input[name="id"]:checked').each(function() {
    			var ip = $(this).attr('id');
    			var val = $(this).val();
    			//alert(val);
    			var unit = $('#unit_'+ip).val();
    			var goodRefSuppliers = $('#goodRefSuppliers_'+ip).val();
    			//alert(goodRefSuppliers);
    			val = val + "," + unit+"," +goodRefSuppliers;
    			chk_value.push(val);
    		});
    		if (chk_value.length == 0) {
    			alert('没有选择任何数据。');
    			return false;
    		}
    		return true;
    	}
    
    	function ext(){
    	   if(jqchk()){
    			var str = "";
    		 	for(var i=0;i<chk_value.length;i++){
    		 		var ips = parseInt(Math.random() * new Date().getTime());
    		 		str = str + "<tr id='gradeTr_"+ips+"'>"
    	               +"<td>" + chk_value[i].split(",")[1] + "</td>"
    	               +"<td>" + chk_value[i].split(",")[2] + "</td>"
    	               +"<td>" + chk_value[i].split(",")[3] + "</td>"
    	               +"<td><input type='hidden' id='suppliers_"+ips+"' value=" + chk_value[i].split(",")[5] + "> "+ chk_value[i].split(",")[4] +"</td>"
    	               +"<td><select id='gradeCode_"+ips+"' style=' 100px;'><option value=''>--请选择--</option><c:forEach var='grade' items='${productGradeList}'><option value='${grade.propertyCode}'>${grade.propertyValue}</option></c:forEach></select></td>"
    	               +"<td><select id='inventoryStatus_"+ips+"' style=' 100px;'><option value=''>--请选择--</option><c:forEach var='status' items='${inventoryStatusList}'><option value='${status.propertyCode}'>${status.propertyValue}</option></c:forEach></select></td>"
    	               +"<td><select id='inventoryType_"+ips+"' style=' 100px;'><option value=''>--请选择--</option><c:forEach var='inventoryType' items='${inventoryTypeList}'><option value='${inventoryType.propertyCode}'<c:if test="${inventoryType.propertyValue=='备件库存'}">selected</c:if>>${inventoryType.propertyValue}</option></c:forEach></select></td>"
    	               +"<td><input type='text' id='itemKey_"+ips+"' value='无'/></td>"
    	               +"<td><input type='text' id='quantity_"+ips+"' onkeyup='javascrit:IsNum(this)'/></td>"
    	               +"<td align='center'><input type='hidden' name='prdId' value='"+chk_value[i].split(",")[0]+"' id='"+ips+"'/><a href='javascript:deleteGoods("+ips+")'>删除</a></td></tr>";
    			}//for
    		 	closePopup();
    			parent.refreshMain(str);
    			//alert(str);
    			parent.hideErrorMsg();
    
    		}//if
         }
    
  • 相关阅读:
    Typora标题自动编号+设定快捷键技巧
    配置redis 4.0.11 集群
    学会使用 Mysql show processlist 排查问题
    Golang学习的方法和建议
    日志文件删除shell脚本
    运维趋势2019年总结,运维就是要做到"技多不压身"
    我的xshell配色方案,绿色/护眼/留存/备份
    对于api接口的爬虫,通常的解决方法
    maven 打包和构建的Linux命令(mvn)
    Istio的流量管理入门-charlieroro编写
  • 原文地址:https://www.cnblogs.com/kyxyes/p/3625962.html
Copyright © 2020-2023  润新知