From e030255c23c7ba3e2cbad1036a810d6d72fa864f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期四, 26 十月 2023 18:04:58 +0800 Subject: [PATCH] 修改bug --- cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js index 1ab2025..e69bfcb 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js @@ -15,7 +15,7 @@ TCompetition.initColumn = function () { return [ {field: 'selectItem', checkbox: true}, - {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, {title: '课包类型', field: 'coursePackageType', visible: true, align: 'center', valign: 'middle'}, @@ -309,14 +309,23 @@ Feng.info("请输入玩湃币支付") return; } + var courseTimeId= $("#courseTime").val() + console.log("看看课时") + console.log(courseTimeId) + if(typeof courseTimeId === 'undefined'){ + console.log("进入") + courseTimeId=0; + } $.ajax({ - url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ $("#courseTime").val(), + url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ courseTimeId, type: "POST", contentType: "application/json", // 设置请求头的 Content-Type data: JSON.stringify(data), // 将数据转换为 JSON 字符串 success: function(response) { if (response == "5001"){ Feng.error("当前课包预约人数已满!") + }else if(response == "5002"){ + Feng.error("剩余课时不足,无法购买!") }else{ Feng.success("上架成功!"); TCompetition.close(); @@ -337,7 +346,11 @@ } TCompetition.getCoursePackage = function (e) { var oneId=$(e).val(); + console.log("门店id") console.log(oneId) + var storeId = $("#store").val(); + console.log("课包类型") + console.log(storeId) var content = "<option value=''>请选择</option>"; var ajax = new $ax(Feng.ctxPath + "/coursePackage/getCoursePackageByType", function(data){ if(data!=null){ @@ -348,7 +361,8 @@ $("#coursePackageName").empty().append(content); } }); - ajax.set("storeId",oneId); + ajax.set("storeId",storeId); + ajax.set("typeId",oneId); ajax.start(); }; TCompetition.getCoursePackageConfig = function (e) { @@ -384,6 +398,18 @@ }; TCompetition.threeChange = function (e) { + var oneId=$(e).val(); + var content1 = "<option value=''>请选择门店</option>"; + var ajax2=new $ax(Feng.ctxPath + "/cpPayment/getStore", function(data){ + $.each(data, function(k,v) { + content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content1); + }); + ajax2.set("city",oneId); + ajax2.start(); +}; +TCompetition.fourChange = function (e) { var content1 = "<option value=''>请选择门店</option>"; var ajax2=new $ax(Feng.ctxPath + "/cpPayment/getStore", function(data){ $.each(data, function(k,v) { @@ -394,7 +420,6 @@ ajax2.set("city",e); ajax2.start(); }; - TCompetition.getStudent = function () { var phone = $("#vipPhone").val(); @@ -507,8 +532,7 @@ if (option.text === city) { option.selected = true; c = option.text; - - TCompetition.threeChange(c) + TCompetition.fourChange(c) break; // 找到匹配的选项后,可以选择停止遍历 } -- Gitblit v1.7.1