From c8441f0e5879b30fa7e771e750d235b480d8102f Mon Sep 17 00:00:00 2001 From: wuyibo <771227828@qq.com> Date: Sat, 12 Nov 2022 16:52:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B5=9B=E7=A8=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/CompetitionTeamVsTeam.java | 2 +- .../src/views/system/competitionSet/index.vue | 239 +++++++++++++++--- 2 files changed, 203 insertions(+), 38 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CompetitionTeamVsTeam.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CompetitionTeamVsTeam.java index 1c3fd013..7a5e5754 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CompetitionTeamVsTeam.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/CompetitionTeamVsTeam.java @@ -41,7 +41,7 @@ public class CompetitionTeamVsTeam extends BaseEntity private String guestTeamName; /** 比赛时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @Excel(name = "比赛时间", width = 60, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date competitionTime; diff --git a/ruoyi-ui/src/views/system/competitionSet/index.vue b/ruoyi-ui/src/views/system/competitionSet/index.vue index 2b3063a2..79163104 100644 --- a/ruoyi-ui/src/views/system/competitionSet/index.vue +++ b/ruoyi-ui/src/views/system/competitionSet/index.vue @@ -171,11 +171,11 @@ 手动设置赛程 @@ -183,8 +183,8 @@ type="success" plain icon="el-icon-bangzhu" - @click="handleUpdate" - v-hasPermi="['system:competitionOfTeam:edit']" + @click="handleMindTeamVsTeam" + v-hasPermi="['system:competitionTeamVsTeam:add']" >系统智能设置小组循环赛赛程 @@ -196,17 +196,50 @@ max-height="800" style=" margin-top: 20px"> - - + + + + + + + - + + + 赛会推广 赛会推广 @@ -305,6 +338,76 @@ 确 定 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -314,6 +417,8 @@ import { listCompetitionOfTeam, batchEditById, intoTeamGroup, removeTeamGroup, u import { listCompetitionMembers, getCompetitionMembers, delCompetitionMembers, addCompetitionMembers, updateCompetitionMembers } from "@/api/system/competitionMembers"; import { listCompetitionTeamGroup, getCompetitionTeamGroup, delCompetitionTeamGroup, addCompetitionTeamGroup, updateCompetitionTeamGroup } from "@/api/system/competitionTeamGroup"; import { listCompetitionTeamVsTeam, getCompetitionTeamVsTeam, delCompetitionTeamVsTeam, addCompetitionTeamVsTeam, updateCompetitionTeamVsTeam } from "@/api/system/competitionTeamVsTeam"; +import { listWxBuilding, getWxBuilding, delWxBuilding, addWxBuilding, updateWxBuilding } from "@/api/system/WxBuilding"; + export default { name: "CompetitionSet", dicts: ['competition_status'], @@ -345,6 +450,28 @@ export default { addTeamDialogVisible:false, teamMultipleSelection:[], // 查询参数 + vsform:{}, + vsTitle:"", + vsRules: { + competitionTime: [ + { required: true, message: "比赛时间不能为空", trigger: "blur" } + ], + mainTeamName: [ + { required: true, message: "主队名不能为空", trigger: "blur" } + ], + guestTeamName: [ + { required: true, message: "客队名不能为空", trigger: "blur" } + ], + buildingName: [ + { required: true, message: "比赛球场名称不能为空", trigger: "blur" } + ], + vsType:[ + { required: true, message: "比赛类型不能为空", trigger: "blur" } + ] + }, + vsOpen:false, + buildingList: [], + buildLoading:false, }; }, created() { @@ -355,21 +482,15 @@ export default { this.competitionObj = response.data; this.loading = false; }); + listCompetitionOfTeam({"pageNum": 1, "pageSize": 1000,"competitionId":id}).then(response => { + this.competitionOfTeamList = response.rows; + }); } }, methods: { onSubmit() { console.log('submit!'); }, - /** 查询比赛信息列表 */ - getList() { - this.loading = true; - listCompetition(this.queryParams).then(response => { - this.competitionList = response.rows; - this.total = response.total; - this.loading = false; - }); - }, //点击新增分组按钮 handleAddGroup(){ //循环获取0-25的组的数据值 @@ -611,31 +732,75 @@ export default { this.open = true; this.title = "添加比赛信息"; }, - /** 修改按钮操作 */ - handleUpdate(row) { - this.reset(); - const id = row.id || this.ids - getCompetition(id).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改比赛信息"; + handleTeamVsTeamAdd(){ + this.vsform = { }; + this.vsOpen=true; + this.vsTitle = "新增赛程" + }, + handleMindTeamVsTeam(){ + + }, + changeMainTeamName(val){ + let obj={} + obj = this.competitionOfTeamList.find(function(i){ + return i.teamId ===val + }); + this.vsform.mainTeamName = obj.teamName; + this.vsform.mainTeamId = val; + //在change中获取到整条对象数据 + console.info(this.vsform) + }, + changeGuestTeamName(val){ + let obj={} + obj = this.competitionOfTeamList.find(function(i){ + return i.teamId ===val + }); + this.vsform.guestTeamName = obj.teamName; + this.vsform.guestTeamId = val; + console.info(this.vsform) + }, + changeBuildName(val){ + let obj={} + obj = this.buildingList.find(function(i){ + return i.id ===val + }); + this.vsform.buildingName = obj.buildingName; + this.vsform.buildingId = val; + this.vsform.competitionAddress=obj.address ; + console.info(this.vsform) + }, + //远程查询球场信息 + remoteMethod(query) { + this.buildLoading = true; + let queryParam = { + "pageNum": 1, "pageSize": 30,"status":2,"isDeleted":0,"buildingName":query + } + listWxBuilding(queryParam).then(response => { + this.buildingList = response.rows; + this.buildLoading = false; }); }, /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { + submitTeamVsTeamForm() { + this.$refs["vsform"].validate(valid => { if (valid) { - if (this.form.id != null) { - updateCompetition(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); + console.info(this.vsform) + if (this.vsform.id != null) { + updateCompetitionTeamVsTeam(this.vsform).then(response => { + this.$modal.msgSuccess("编辑赛程成功"); + this.vsOpen = false; + listCompetitionTeamVsTeam({"orderByColumn":"competition_time","pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => { + this.competitionTeamVsTeamList = response.rows; + }); }); } else { - addCompetition(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); + this.vsform.competitionId = this.competitionObj.id; + addCompetitionTeamVsTeam(this.vsform).then(response => { + this.$modal.msgSuccess("新增赛程成功"); + this.vsOpen = false; + listCompetitionTeamVsTeam({"orderByColumn":"competition_time","pageNum": 1, "pageSize": 1000,"competitionId":this.competitionObj.id}).then(response => { + this.competitionTeamVsTeamList = response.rows; + }); }); } }