From 5c124723a5b7b48da80dc49ddf4c9deca851eaff Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期一, 16 十月 2023 15:46:07 +0800
Subject: [PATCH] 10.16
---
cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition.js | 167 ++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 108 insertions(+), 59 deletions(-)
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition.js b/cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition.js
index 12291b0..48f86db 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition.js
@@ -1,8 +1,8 @@
/**
* 车辆管理管理初始化
*/
-var TCar = {
- id: "TCarTable", //表格id
+var TCompetition = {
+ id: "TCompetitionTable", //表格id
seItem: null, //选中的条目
table: null,
layerIndex: -1
@@ -11,23 +11,32 @@
/**
* 初始化表格的列
*/
-TCar.initColumn = function () {
+TCompetition.initColumn = function () {
return [
{field: 'selectItem', radio: true},
- {title: '所在省', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'},
+ {title: '所在省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'8%',
},
- {title: '所在市', field: 'id', visible: true, align: 'center', valign: 'middle'},
- {title: '举办门店', field: 'companyName', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '所在市', field: 'city', visible: true, align: 'center', valign: 'middle'},
+ {title: '举办门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',width:'8%',
},
- {title: '赛事名称', field: 'brandName', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '赛事名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%',
},
- {title: '开始时间', field: 'modelName', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:'8%',
},
- {title: '结束时间', field: 'carColor', visible: true, align: 'center', valign: 'middle',width:'5%',
+ {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:'5%',
},
- {title: '最大人数-已报名人数', field: 'serverStr', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '最大人数-已报名人数', field: 'applicantsNumber', visible: true, align: 'center', valign: 'middle',width:'8%',
},
- {title: '报名条件', field: 'carLicensePlate', visible: true, align: 'center', valign: 'middle',width:'8%',
+ {title: '报名条件', field: 'registerCondition', visible: true, align: 'center', valign: 'middle',width:'8%',
+ formatter:function (data) {
+ return {1:"全部用户",2:"仅限年度会员参与",3:"仅限学员参与"}[data]
+ }
+ },
+ {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',width:'8%',
+ formatter:function (data) {
+ return {1:"未开始",2:"已开始",3:"已结束",4:"已取消"}[data]
+ }
},
];
};
@@ -67,13 +76,13 @@
/**
* 检查是否选中
*/
-TCar.check = function () {
+TCompetition.check = function () {
var selected = $('#' + this.id).bootstrapTable('getSelections');
if(selected.length == 0){
Feng.info("请先选中表格中的某一记录!");
return false;
}else{
- TCar.seItem = selected[0];
+ TCompetition.seItem = selected[0];
return true;
}
};
@@ -81,14 +90,14 @@
/**
* 点击添加车辆管理
*/
-TCar.openAddTCar = function () {
+TCompetition.openAddTCompetition = function () {
var index = layer.open({
type: 2,
title: '添加',
area: ['100%', '100%'], //宽高
fix: false, //不固定
maxmin: true,
- content: Feng.ctxPath + '/tCar/tCar_add'
+ content: Feng.ctxPath + '/tCompetition/tCompetition_add'
});
this.layerIndex = index;
};
@@ -96,7 +105,7 @@
/**
* 打开查看车辆管理详情
*/
-TCar.openTCarDetail = function () {
+TCompetition.openTCompetitionDetail = function () {
if (this.check()) {
var index = layer.open({
type: 2,
@@ -104,7 +113,33 @@
area: ['100%', '100%'], //宽高
fix: false, //不固定
maxmin: true,
- content: Feng.ctxPath + '/tCar/tCar_update/' + TCar.seItem.id
+ content: Feng.ctxPath + '/tCompetition/tCompetition_update/' + TCompetition.seItem.id
+ });
+ this.layerIndex = index;
+ }
+};
+TCompetition.info = function () {
+ if (this.check()) {
+ var index = layer.open({
+ type: 2,
+ title:'详情',
+ area: ['100%', '100%'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tCompetition/tCompetition_info/' + TCompetition.seItem.id
+ });
+ this.layerIndex = index;
+ }
+};
+TCompetition.user = function () {
+ if (this.check()) {
+ var index = layer.open({
+ type: 2,
+ title:'详情',
+ area: ['100%', '100%'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tCompetition/tCompetition_user/' + TCompetition.seItem.id
});
this.layerIndex = index;
}
@@ -113,9 +148,9 @@
/**
* 删除车辆管理
*/
-TCar.delete = function () {
+TCompetition.delete = function () {
if (this.check()) {
- var nickname = TCar.seItem.carLicensePlate;
+ var nickname = TCompetition.seItem.carLicensePlate;
if (nickname == "" || nickname == null || nickname == undefined){
nickname = "该车辆";
}else{
@@ -130,7 +165,7 @@
confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'),
closeOnConfirm: true
}, function () {
- var ajax = new $ax(Feng.ctxPath + "/tCar/delete", function (data) {
+ var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) {
if(language==1){
swal("删除成功", "您已经成功删除了" + nickname + "。", "success");
}else if(language==2){
@@ -138,7 +173,7 @@
}else {
swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success");
}
- TCar.table.refresh();
+ TCompetition.table.refresh();
}, function (data) {
if(language==1){
swal("删除失败", data.responseJSON.message + "!", "warning");
@@ -149,14 +184,14 @@
}
});
- ajax.set("tCarId",TCar.seItem.id);
+ ajax.set("TCompetitionId",TCompetition.seItem.id);
ajax.start();
});
}
};
-TCar.carInsurance = function () {
+TCompetition.carInsurance = function () {
if (this.check()) {
var index = layer.open({
type: 2,
@@ -164,7 +199,7 @@
area: ['100%', '100%'], //宽高
fix: false, //不固定
maxmin: true,
- content: Feng.ctxPath + '/tCar/carInsurance?carId=' + TCar.seItem.id
+ content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id
});
this.layerIndex = index;
}
@@ -175,47 +210,61 @@
/**
* 查询车辆管理列表
*/
-TCar.search = function () {
+TCompetition.search = function () {
var queryData = {};
- queryData['createTime'] = $("#createTime").val();
- queryData['id'] = $("#id").val();
- queryData['brandName'] = $("#brandName").val();
- queryData['modelName'] = $("#modelName").val();
- queryData['carColor'] = $("#carColor").val();
- queryData['serverStr'] = $("#serverStr").val();
- queryData['carLicensePlate'] = $("#carLicensePlate").val();
- queryData['driverName'] = $("#driverName").val();
- queryData['companyName'] = $("#companyName").val();
- queryData['franchiseeName'] = $("#franchiseeName").val();
- TCar.table.refresh({query: queryData});
+ queryData['provinceCode'] = $("#pCode").val();
+ queryData['cityCode'] = $("#cCode").val();
+ queryData['shopName'] = $("#shopName").val();
+ queryData['eventName'] = $("#eventName").val();
+ queryData['time'] = $("#createTime").val();
+ queryData['state'] = $("#state").val();
+ queryData['registerCondition'] = $("#registerCondition").val();
+ TCompetition.table.refresh({query: queryData});
};
-
-TCar.resetSearch = function () {
+TCompetition.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.code+"'>"+v.name+"</option>";
+ });
+ $("#cCode").empty().append(content);
+ }
+ });
+ ajax.set("oneId",oneId);
+ ajax.start();
+}
+TCompetition.resetSearch = function () {
+ $("#pCode").val("");
+ $("#cCode").val("");
+ $("#shopName").val("");
+ $("#eventName").val("");
$("#createTime").val("");
- $("#id").val("");
- $("#brandName").val("");
- $("#modelName").val("");
- $("#carColor").val("");
- $("#serverStr").val("");
- $("#carLicensePlate").val("");
- $("#driverName").val("");
- $("#companyName").val("");
- $("#franchiseeName").val("");
- TCar.search();
+ $("#state").val("");
+ $("#registerCondition").val("");
+ TCompetition.search();
};
$(function () {
- var defaultColunms = TCar.initColumn();
- var table = new BSTable(TCar.id, "/tCompetition/list", defaultColunms);
+ var defaultColunms = TCompetition.initColumn();
+ var table = new BSTable(TCompetition.id, "/tCompetition/list", defaultColunms);
table.setPaginationType("server");
- TCar.table = table.init();
+ TCompetition.table = table.init();
});
/**
* 下载模板
*/
-TCar.uploadCarModel = function () {
- window.location.href = Feng.ctxPath + "/tCar/uploadCarModel";
+TCompetition.uploadCarModel = function () {
+ window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel";
}
var agreement = function(){
@@ -229,7 +278,7 @@
/**
* 导入合同
*/
-TCar.exportCar = function () {
+TCompetition.exporTCompetition = function () {
var uploadEventFile = $("#uploadEventFile").val();
if(uploadEventFile == ''){
if(language==1){
@@ -248,7 +297,7 @@
Feng.info("Hanya berkas Excel yang dapat diunggah");
}
}else{
- var url = Feng.ctxPath + '/tCar/exportCar';
+ var url = Feng.ctxPath + '/TCompetition/exporTCompetition';
var file = document.querySelector('input[name=file]').files[0];
var reader = new FileReader();
if (file) {
@@ -258,7 +307,7 @@
}
}
}
-TCar.sendAjaxRequest = function(url,type,data){
+TCompetition.sendAjaxRequest = function(url,type,data){
$.ajax({
url : url,
type : type,
@@ -275,7 +324,7 @@
Feng.success("Import berhasil!");
}
}
- TCar.table.refresh();
+ TCompetition.table.refresh();
},
error : function() {
if(language==1){
@@ -301,9 +350,9 @@
/**
* 导出车辆操作
*/
-TCar.outCar = function () {
+TCompetition.ouTCompetition = function () {
var operation = function() {
- window.location.href = Feng.ctxPath + "/tCar/outCar";
+ window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition";
};
if(language==1){
Feng.confirm("是否确认导出车辆信息?", operation);
--
Gitblit v1.7.1