| | |
| | | Feng.info("请选择课包名称") |
| | | return; |
| | | } |
| | | |
| | | var selectElement = document.getElementById('coursePackageName'); |
| | | var selectedOption = selectElement.options[selectElement.selectedIndex]; |
| | | console.log("插入") |
| | | var type = selectedOption.getAttribute('data-type'); |
| | | console.log('type----------'+type) |
| | | |
| | | |
| | | |
| | | if (type==1) { |
| | | if (role == 1) { |
| | | if ($("#courseTime").val() == '') { |
| | | Feng.info("请选择课时规格") |
| | | return; |
| | | } |
| | | } |
| | | }else { |
| | | data.classHours = 0 |
| | | } |
| | | if($("#cashPayment").val()==''){ |
| | | Feng.info("请输入支付金额") |
| | | return; |
| | |
| | | courseTimeId=0; |
| | | } |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ courseTimeId, |
| | | url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data), // 将数据转换为 JSON 字符串 |
| | |
| | | if(data!=null){ |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | // content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | content += "<option value='"+v.id+"' data-type='"+v.type+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#coursePackageName").empty().append(content); |
| | | } |