| | |
| | | TQuestion.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: true, align: 'center', valign: 'middle'}, |
| | | {title: '预约门店', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '家长姓名', field: 'parentName', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | TQuestion.dataCount = 0; |
| | | TQuestion.phone = ""; |
| | | TQuestion.phoneId = ""; |
| | | |
| | | TQuestion.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择市</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | }; |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/benefits/update/' + TQuestion.seItem.id |
| | | content: Feng.ctxPath + '/bodySideAppointment/update/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(ids), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("上架成功!"); |
| | | Feng.success("修改成功!"); |
| | | TQuestion.search(); |
| | | |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "修改失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | } |
| | | }); |
| | |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("下架成功!"); |
| | | Feng.success("修改成功!"); |
| | | TQuestion.search(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "修改失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | /** |
| | | * 查看详情 |
| | | */ |
| | | TQuestion.getInfo = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length >1 ){ |
| | | Feng.info("只能选择一条进行查看!"); |
| | | }else { |
| | | if (this.check()){ |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/benefits/info/' + TQuestion.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | }); |
| | | } |
| | | }; |
| | | TQuestion.oneChange = function () { |
| | | var province = $('#pCode option:selected').text(); |
| | | var citySelect = document.getElementById("cCode"); |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/getCity", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择市</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.cityCode+"'>"+v.city+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | if (province === ""){ |
| | | citySelect.innerHTML = '<option value="">请先选择省</option>'; |
| | | } |
| | | ajax.set("province",province); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | TQuestion.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | |
| | | ajax1.start(); |
| | | }; |
| | | TQuestion.addSubmit = function(){ |
| | | |
| | | var data = { |
| | | id:null, |
| | | province:"", |
| | |
| | | data: JSON.stringify(data), |
| | | contentType: "application/json", |
| | | success: function (response) { |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.close(); |
| | | Feng.success("添加成功"); |
| | | }, |
| | | error: function (xhr, status, error) { |
| | |
| | | data: JSON.stringify(data), |
| | | contentType: "application/json", |
| | | success: function (response) { |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.close(); |
| | | Feng.success("添加成功"); |
| | | }, |
| | | error: function (xhr, status, error) { |
| | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TQuestion.search = function () { |
| | | TQuestion.search = function (e) { |
| | | |
| | | var queryData = {}; |
| | | |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['parentName'] = $("#parentName").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['day'] = e; |
| | | TQuestion.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | TQuestion.close = function() { |
| | | parent.layer.close(window.parent.TQuestion.layerIndex); |
| | | } |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | |
| | | $("#phone").val(''); |
| | | $("#parentName").val(''); |
| | | $("#state").val(''); |
| | | TQuestion.search(); |
| | | TQuestion.search(null); |
| | | }; |
| | | |
| | | |
| | | $(function () { |
| | | var defaultColunms = TQuestion.initColumn(); |
| | | var table = new BSTable(TQuestion.id, "/bodySideAppointment/listAll", defaultColunms); |