| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | var TQuestion = { |
| | | id: "TQuestionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var role = $("#roleType").val() |
| | | var appUserId; |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TQuestion.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {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'}, |
| | | {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '购课学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, |
| | | { |
| | | title: '购买方式', field: 'buyType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (data) { |
| | | return {1: "线下", 2: "线上", 3: "折扣"}[data] |
| | | } |
| | | }, |
| | | {title: '支付方式', field: 'buyTypeName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '总金额', field: 'originalPrice', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠金额', field: 'discountAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付价格', field: 'cashPayment', visible: true, align: 'center', valign: 'middle'}, |
| | | { |
| | | title: '支付状态', field: 'payStatus', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (data) { |
| | | return {1: "待支付", 2: "已支付"}[data] |
| | | } |
| | | }, |
| | | {title: '赠送课时', field: 'giftClassHours', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | function currentTime(timestamp) { |
| | | var time = timestamp + ''; |
| | | if (time.length != 13) { |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp); |
| | | ; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp) { |
| | | var time = timestamp + ''; |
| | | if (time.length != 13) { |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp); |
| | | ; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D; |
| | | return strDate |
| | | } |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TQuestion.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | TQuestion.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | TQuestion.openAddTQuestion = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/cpPayment/add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | TQuestion.openTQuestionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_update/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TQuestion.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_info/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TQuestion.gift = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '免费福利', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_gift/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TQuestion.indexSet = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '首页设置', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_indexSet/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | * 删除车辆管理 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | TQuestion.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TQuestion.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined) { |
| | | nickname = "该车辆"; |
| | | } else { |
| | | nickname = "【" + nickname + "】"; |
| | | } |
| | | swal({ |
| | | title: language == 1 ? "您是否确认删除" + nickname + "?" : (language == 2 ? "Are you sure to delete the" + nickname + "?" : "Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language == 1 ? "请谨慎操作!" : (language == 2 ? ' Please operate with caution!' : 'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language == 1 ? "删除" : (language == 2 ? 'Delete' : 'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if (language == 1) { |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | } else if (language == 2) { |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | } else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TQuestion.table.refresh(); |
| | | }, function (data) { |
| | | if (language == 1) { |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | } else if (language == 2) { |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | } else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | }); |
| | | ajax.set("TCompetitionId", TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | TQuestion.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId = $(e).val(); |
| | | console.log(oneId) |
| | | var content = "<option value=''>请选择</option>"; |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function (data) { |
| | | if (data != null) { |
| | | |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.name + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId", oneId); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | TQuestion.nextStore = function (e) { |
| | | var oneId = $(e).val(); |
| | | console.log(oneId) |
| | | var content = "<option value=''>请选择</option>"; |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/getCoursePackageByStoreId", function (data) { |
| | | if (data != null) { |
| | | |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#coursePackageType").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("storeId", oneId); |
| | | ajax.start(); |
| | | }; |
| | | TQuestion.addSubmit = function () { |
| | | let studentId = $("#student").val(); |
| | | let pCode = $("#pCode").val(); |
| | | let cCode = $("#cCode").val(); |
| | | let store = $("#store").val(); |
| | | let coursePackageType = $("#coursePackageType").val(); |
| | | let coursePackageName = $("#coursePackageName").val(); |
| | | if (studentId == '' || studentId == null) { |
| | | Feng.info("请选择学员") |
| | | return; |
| | | } |
| | | if (pCode == '' || pCode == null) { |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if (cCode == '' || cCode == null) { |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if (store == '' || store == null) { |
| | | Feng.info("请选择门店") |
| | | return; |
| | | } |
| | | if (coursePackageType == '' || coursePackageType == null) { |
| | | Feng.info("请选择课包类型") |
| | | return; |
| | | } |
| | | if (coursePackageName == '' || coursePackageName == null) { |
| | | Feng.info("请选择课包名称") |
| | | return; |
| | | } |
| | | var data = { |
| | | appUserId: null, |
| | | studentId: null, |
| | | coursePackageId: null, |
| | | payType: null, |
| | | classHours: null, |
| | | originalPrice: null, |
| | | cashPayment: null, |
| | | playPaiCoin: null, |
| | | totalClassHours: null, |
| | | laveClassHours: null, |
| | | absencesNumber: null, |
| | | payUserType: 2, |
| | | payStatus: 1, |
| | | orderNumber: null, |
| | | payUserId: 2, |
| | | status: 1, |
| | | withdrawalTime: "", |
| | | certificate: "", |
| | | state: 1, |
| | | giftClassHours: null, |
| | | useTime: "", |
| | | payUserName: "", |
| | | coursePackageConfigId: null |
| | | }; |
| | | data.appUserId = appUserId; |
| | | data.coursePackageConfigId = $("#courseTime").val(); |
| | | data.studentId = $("#student").val() |
| | | data.coursePackageId = $("#coursePackageName").val() |
| | | data.cashPayment = $("#cashPayment").val() |
| | | data.playPaiCoin = $("#playPaiCoin").val() |
| | | data.classHours = $('#courseTime option:selected').text() |
| | | var selectElement = document.getElementById('coursePackageName'); |
| | | var selectedOption = selectElement.options[selectElement.selectedIndex]; |
| | | var type = selectedOption.getAttribute('data-type'); |
| | | |
| | | |
| | | if (type == 1) { |
| | | if (role == 1) { |
| | | if ($("#courseTime").val() == '') { |
| | | Feng.info("请选择课时规格") |
| | | return; |
| | | } |
| | | } |
| | | } else { |
| | | data.classHours = 0 |
| | | } |
| | | if ($("#cashPayment").val() == '') { |
| | | Feng.info("请输入支付金额") |
| | | return; |
| | | } |
| | | if ($("#playPaiCoin").val() == '') { |
| | | Feng.info("请输入玩湃币支付") |
| | | return; |
| | | } |
| | | var courseTimeId = $("#courseTime").val() |
| | | console.log("看看课时") |
| | | console.log(courseTimeId) |
| | | data.coursePackageConfigId = courseTimeId; |
| | | if (typeof courseTimeId === 'undefined') { |
| | | console.log("进入") |
| | | courseTimeId = 0; |
| | | } |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment", |
| | | 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("购买成功!"); |
| | | TQuestion.close(); |
| | | window.parent.TQuestion.table.refresh(); |
| | | } |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | } |
| | | }); |
| | | }; |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | TQuestion.close = function () { |
| | | parent.layer.close(window.parent.TQuestion.layerIndex); |
| | | } |
| | | TQuestion.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) { |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | $.each(data, function (k, v) { |
| | | // content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | content += "<option value='" + v.id + "' data-type='" + v.type + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#coursePackageName").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("storeId", storeId); |
| | | ajax.set("typeId", oneId); |
| | | ajax.start(); |
| | | }; |
| | | TQuestion.getCoursePackageConfig = function (e) { |
| | | var c1 = document.getElementById("c1"); |
| | | var c2 = document.getElementById("c2"); |
| | | var oneId = $(e).val(); |
| | | console.log(oneId) |
| | | var content = "<option value=''>请选择</option>"; |
| | | var ajax = new $ax(Feng.ctxPath + "/cpPayment/getCoursePackageConfig", function (data) { |
| | | if (data != null) { |
| | | |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "' data-cashPayment='" + v.cashPayment + "' data-playPaiCoin='" + v.playPaiCoin + "'>" + v.classHours + "</option>"; |
| | | }); |
| | | $("#courseTime").empty().append(content); |
| | | } else { |
| | | c1.style.display = "none"; |
| | | c2.style.display = "none"; |
| | | } |
| | | }); |
| | | if (oneId == "") { |
| | | console.log("关闭"); |
| | | c1.style.display = "none"; |
| | | c2.style.display = "none"; |
| | | } else { |
| | | console.log("展示") |
| | | c1.style.display = 'block' |
| | | c2.style.display = 'block' |
| | | } |
| | | ajax.set("id", oneId); |
| | | ajax.start(); |
| | | |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/cpPayment/getCoursePackageType", function (data) { |
| | | if (data != null) { |
| | | console.log("data ====" + data) |
| | | if (data != 1) { |
| | | document.getElementById("toHidden").style.display = "none"; |
| | | |
| | | var selectElement = document.getElementById('courseTime'); |
| | | var selectedOption = selectElement.options[1]; |
| | | console.log("插入") |
| | | var cashPayment = selectedOption.getAttribute('data-cashpayment'); |
| | | var playPaiCoin = selectedOption.getAttribute('data-playpaicoin'); |
| | | console.log(cashPayment) |
| | | console.log(playPaiCoin) |
| | | $("#cashPayment").val(cashPayment); |
| | | $("#playPaiCoin").val(playPaiCoin); |
| | | |
| | | |
| | | } else { |
| | | document.getElementById("toHidden").style.display = "block"; |
| | | |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | |
| | | } |
| | | }); |
| | | |
| | | ajax1.set("id", oneId); |
| | | ajax1.start(); |
| | | |
| | | }; |
| | | TQuestion.getCoursePackagePrice = function (e) { |
| | | var c1 = document.getElementById("c1"); |
| | | var c2 = document.getElementById("c2"); |
| | | var oneId = $(e).val(); |
| | | var selectElement = document.getElementById('courseTime'); |
| | | var selectedOption = selectElement.options[selectElement.selectedIndex]; |
| | | console.log("插入") |
| | | var cashPayment = selectedOption.getAttribute('data-cashpayment'); |
| | | var playPaiCoin = selectedOption.getAttribute('data-playpaicoin'); |
| | | console.log(cashPayment) |
| | | console.log(playPaiCoin) |
| | | $("#cashPayment").val(cashPayment); |
| | | $("#playPaiCoin").val(playPaiCoin); |
| | | }; |
| | | TQuestion.twoChange = function (e) { |
| | | var oneId = e; |
| | | var content = "<option value=''>请选择</option>"; |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function (data) { |
| | | if (data != null) { |
| | | |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.name + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.set("oneId", oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/oneChangeNext", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择账号</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }; |
| | | |
| | | TQuestion.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); |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.saveImg = function () { |
| | | var id=$("#id").val(); |
| | | var img=$("#welfarePicture").val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImg", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功") |
| | | } |
| | | ajax2.set("city", oneId); |
| | | ajax2.start(); |
| | | }; |
| | | TQuestion.fourChange = function (e) { |
| | | 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); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("img",img); |
| | | ajax.start(); |
| | | } |
| | | ajax2.set("city", e); |
| | | ajax2.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | TQuestion.getStudent = function () { |
| | | var phone = $("#vipPhone").val(); |
| | | var phoneRegex = /^1[3456789]\d{9}$/; |
| | | // 使用正则表达式进行验证 |
| | | if (!phoneRegex.test(phone)) { |
| | | Feng.error("手机号不合法"); |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | // 回填省市 |
| | | var province; |
| | | var city; |
| | | var c; |
| | | var content = "<option value=''>请选择学员</option>"; |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/getUserByPhone/" + phone, |
| | | type: "GET", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | success: function (response) { |
| | | console.log("==================="); |
| | | console.log(response) |
| | | if (response == "") { |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <h2>验证失败,当前手机号未注册玩湃会员</h2>\n' + |
| | | ' </div>'; |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | if(img==''){ |
| | | Feng.info("请上传门店封面") |
| | | return; |
| | | } |
| | | var goodImgs = this.goodsPicArray; |
| | | if(goodImgs.length==0){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | var imgOne =""; |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",null); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("lat",$("#latitude").val()); |
| | | ajax.set("lon",$("#longitude").val()); |
| | | ajax.set("ids",$("#ids").val()); |
| | | ajax.set("type",OBJradio); |
| | | ajax.set("yyId",$("#account").val()); |
| | | ajax.start(); |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '提示' |
| | | , area: ['50%', '90%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['去添加', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加用户', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/appUser/add' |
| | | }); |
| | | // layer.closeAll('page'); |
| | | }, |
| | | btn2: function () { |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }); |
| | | } else { |
| | | console.log('定位失败!'); |
| | | province = response.province; |
| | | city = response.city; |
| | | appUserId = response.id; |
| | | var ajax1 = new $ax(Feng.ctxPath + "/cpPayment/queryStudentList", function (data) { |
| | | |
| | | if (data.length == 0) { |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <h2>验证失败,当前用户未添加学员信息</h2>\n' + |
| | | ' </div>'; |
| | | |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '提示' |
| | | , area: ['50%', '90%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['去添加', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '首页设置', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/appUser/addStudent/' + appUserId |
| | | }); |
| | | // layer.closeAll('page'); |
| | | }, |
| | | }); |
| | | } |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#student").empty().append(content); |
| | | var provinceSelect = document.getElementById("pCode"); |
| | | for (var i = 0; i < provinceSelect.options.length; i++) { |
| | | var option = provinceSelect.options[i]; |
| | | if (option.text === province) { |
| | | option.selected = true; |
| | | console.log(option.value) |
| | | TQuestion.twoChange(option.value); |
| | | break; // 找到匹配的选项后,可以选择停止遍历 |
| | | } |
| | | } |
| | | |
| | | var content1 = "<option value=''>请选择门店</option>"; |
| | | var citySelect = document.getElementById("cCode"); |
| | | for (var i = 0; i < citySelect.options.length; i++) { |
| | | var option = citySelect.options[i]; |
| | | if (option.text === city) { |
| | | option.selected = true; |
| | | c = option.text; |
| | | TQuestion.fourChange(c) |
| | | |
| | | break; // 找到匹配的选项后,可以选择停止遍历 |
| | | } |
| | | } |
| | | }); |
| | | ajax1.set("appUserId", appUserId); |
| | | ajax1.start(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | |
| | | }; |
| | | |
| | | TQuestion.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TQuestion.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TQuestion.unfreeze = function () { |
| | | if (this.check()) { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | console.log("看看选择") |
| | | console.log(selected) |
| | | const data1 = { |
| | | ids: [], |
| | | payUserName: "" |
| | | }; |
| | | selected.forEach(function (obj) { |
| | | var id = ""; |
| | | id = obj.id; |
| | | data1.ids.push(id); |
| | | }); |
| | | console.log(data1) |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/pay", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function (response) { |
| | | Feng.success("支付成功!"); |
| | | TQuestion.table.refresh(); |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | TQuestion.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TQuestion.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | }; |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | TQuestion.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language == 1 ? '车辆保险' : (language == 2 ? 'Vehicle insurance' : 'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TQuestion/carInsurance?carId=' + TQuestion.seItem.id |
| | | }); |
| | | }) |
| | | } |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | TQuestion.search = function () { |
| | | var queryData = {}; |
| | | if ($('#pCode option:selected').text() != "全部") { |
| | | queryData['province'] = $('#pCode option:selected').text(); |
| | | } else { |
| | | queryData['province'] = ""; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | var OBJradio= $("input[name='type']:checked").val(); |
| | | if(OBJradio==2){ |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属运营商") |
| | | return; |
| | | } |
| | | } |
| | | queryData['city'] = $("#cCode").val(); |
| | | queryData['coursePackageTypeId'] = $("#coursePackage").val(); |
| | | queryData['coursePackageTypeName'] = $("#coursePackageName").val(); |
| | | queryData['payStatus'] = $("#state").val(); |
| | | queryData['payUser'] = $("#payUser").val(); |
| | | queryData['payStudent'] = $("#payStudent").val(); |
| | | TQuestion.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | TQuestion.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#coursePackage").val(""); |
| | | $("#coursePackageName").val(""); |
| | | $("#state").val(""); |
| | | $("#payUser").val(""); |
| | | $("#payStudent").val(""); |
| | | TQuestion.search(); |
| | | }; |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | |
| | | let imgOne = $("#imgOne").val() |
| | | |
| | | if(imgOne==''){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",account); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("c1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c2"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c3"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c4"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c5"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c6"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c7"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c8"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | //地图搜索 |
| | | TCarInfoDlg.searchByStationName(); |
| | | $(function () { |
| | | var defaultColunms = TQuestion.initColumn(); |
| | | var table = new BSTable(TQuestion.id, "/cpPayment/listAll", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TQuestion.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.saveAllImg = function (e) { |
| | | var id = $("#id").val() |
| | | var px1 = $("#px1").val() |
| | | var px2 = $("#px2").val() |
| | | var px3 = $("#px3").val() |
| | | var px4 = $("#px4").val() |
| | | var px5 = $("#px5").val() |
| | | var px6 = $("#px6").val() |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | | var c4 = $("#c4").val() |
| | | var c5 = $("#c5").val() |
| | | var c6 = $("#c6").val() |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | | var r4 = document.querySelector('input[name="r4"]').checked; |
| | | var r5 = document.querySelector('input[name="r5"]').checked; |
| | | var r6 = document.querySelector('input[name="r6"]').checked; |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | if(r1){ |
| | | r1 =1 |
| | | }else{ |
| | | r1=0 |
| | | } |
| | | if(r2){ |
| | | r2 =1 |
| | | }else{ |
| | | r2=0 |
| | | } |
| | | if(r3){ |
| | | r3 =1 |
| | | }else{ |
| | | r3=0 |
| | | } |
| | | if(r4){ |
| | | r4 =1 |
| | | }else{ |
| | | r4=0 |
| | | } |
| | | if(r5){ |
| | | r5 =1 |
| | | }else{ |
| | | r5=0 |
| | | } |
| | | if(r6){ |
| | | r6 =1 |
| | | }else{ |
| | | r6=0 |
| | | } |
| | | if(r7){ |
| | | r7 =1 |
| | | }else{ |
| | | r7=0 |
| | | } |
| | | if(r8){ |
| | | r8 =1 |
| | | }else{ |
| | | r8=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("px1",px1); |
| | | ajax.set("px2",px2); |
| | | ajax.set("px3",px3); |
| | | ajax.set("px4",px4); |
| | | ajax.set("px5",px5); |
| | | ajax.set("px6",px6); |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | | ajax.set("c4",c4); |
| | | ajax.set("c5",c5); |
| | | ajax.set("c6",c6); |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | | ajax.set("r4",r4); |
| | | ajax.set("r5",r5); |
| | | ajax.set("r6",r6); |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |