$(document).on(‘change’, “#wares_name”, function (e) {
let ID = $(“option:selected”,this).attr(“class”);//需求主键
var TypeName=""
console.log(ID);
$.ajax({
//请求方式
type:‘POST’,
async: true,
//发送请求的地址
//我这里的地址是不需要传数据的,所以没有拼接参数
url:‘http://192.168.0.102:8020/Storage/INWarehouseType’,
//服务器返回的数据类型
data:{
ID:ID
},
dataType:‘json’,
//请求成功的处理
success:function(data){
console.log(data);
TypeName=data[0].TypeName
selewares_type.append(""+data[0].TypeName+"")
// 商品名称下拉框渲染
// for (var k = 0; k < KaTeX parse error: Expected '}', got 'EOF' at end of input: … // if(k==(“select[id=wares_name]”).length-1){
// $(“select[id=wares_name]”).eq(k).append(str)
// }
// }
},
//请求失败的处理
error:function(jqXHR){
console.log(jqXHR);
}
});
// var selewares_type
var selewares_type=$(this).parents("tr").find('select[id=wares_type]')
console.log($(this).parents("tr").find('select[id=wares_type]'))
});