dev_review
yujialong 7 months ago
parent 267dd86ac0
commit 5fdb75fec9
  1. 4
      src/utils/http.js
  2. 41
      src/views/customer/AddCustomer.vue
  3. 4
      src/views/match/manage/matchArchList.vue
  4. 65
      src/views/match/manage/matchInfo.vue
  5. 2
      src/views/match/manage/matchRank.vue
  6. 12
      src/views/match/manage/matchReport.vue
  7. 6
      src/views/match/manage/matchSignup.vue

@ -30,6 +30,7 @@ axios.interceptors.request.use(config => {
return Promise.reject(err); return Promise.reject(err);
}) })
let logouted = 0;
// 响应拦截器 // 响应拦截器
axios.interceptors.response.use( axios.interceptors.response.use(
response => { response => {
@ -62,6 +63,7 @@ axios.interceptors.response.use(
// 未登录则跳转登录页面,并携带当前页面的路径 // 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。 // 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401: case 401:
if (!logouted) {
Message.error('登录过期,请重新登录!'); Message.error('登录过期,请重新登录!');
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({
@ -71,6 +73,8 @@ axios.interceptors.response.use(
} }
}); });
}, 1000); }, 1000);
logouted = 1
}
break; break;
// 403 token过期 // 403 token过期
// 登录过期对用户进行提示 // 登录过期对用户进行提示

@ -522,7 +522,7 @@
alt=""> alt="">
</el-dialog> </el-dialog>
<el-dialog :title="curRow ? '编辑客户' : '创建客户'" <el-dialog :title="curRow ? '编辑客户' : '添加客户'"
:visible.sync="customerVisible" :visible.sync="customerVisible"
width="300px" width="300px"
class="dialog" class="dialog"
@ -942,10 +942,10 @@ export default {
this.dataPermissionss = res.result.dataPermissionss this.dataPermissionss = res.result.dataPermissionss
this.getCityData() this.getCityData()
this.changIndustryData() this.changIndustryData()
this.getSchoolData() this.getSchool()
}).catch((res) => { }) }).catch((res) => { })
} else { } else {
this.getSchoolData() this.getSchool()
} }
}, },
methods: { methods: {
@ -1064,7 +1064,6 @@ export default {
setCustomer () { setCustomer () {
this.initCustomer() this.initCustomer()
this.customerListVisible = true this.customerListVisible = true
// this.customerVisible = true
}, },
handleCurrentChangeCustomer (val) { handleCurrentChangeCustomer (val) {
this.pageCustomer = val this.pageCustomer = val
@ -1088,6 +1087,13 @@ export default {
// //
addCustomer () { addCustomer () {
this.curRow = null this.curRow = null
this.customerForm = {
schoolName: '',
provinceId: '',
cityId: '',
customerId: '',
schoolId: '',
}
this.customerVisible = true this.customerVisible = true
}, },
// //
@ -1110,6 +1116,7 @@ export default {
}).then(async () => { }).then(async () => {
await this.$post(`${this.api.delClientsOrSchools}?schoolId=${row.schoolId}`).then(res => { await this.$post(`${this.api.delClientsOrSchools}?schoolId=${row.schoolId}`).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getSchool(row.schoolId)
this.getCustomer() this.getCustomer()
}) })
}).catch(() => { }) }).catch(() => { })
@ -1134,24 +1141,28 @@ export default {
const row = this.curRow const row = this.curRow
form.customerName = form.schoolName form.customerName = form.schoolName
let res
try {
if (this.curRow) { if (this.curRow) {
if (row.bindOrNot) { if (row.bindOrNot) {
// //
await this.$post(this.api.clientSettingsEditClient, form) res = await this.$post(this.api.clientSettingsEditClient, form)
} else { } else {
// //
await this.$post(this.api.editClientsOrSchools, form) res = await this.$post(this.api.editClientsOrSchools, form)
} }
} else { } else {
// //
await this.$get(this.api.addNewCustomersByOneself, form) res = await this.$get(this.api.addNewCustomersByOneself, form)
}
} finally {
this.submiting = false
} }
this.customerVisible = false this.customerVisible = false
this.submiting = false
this.$message.success('添加成功') this.$message.success('添加成功')
this.getCustomer() this.getCustomer()
this.getSchoolData(res.schoolId) this.getSchool(res.schoolId || '')
}, },
// //
getCategory () { getCategory () {
@ -1289,12 +1300,7 @@ export default {
this.form.customerName = '' this.form.customerName = ''
}, },
// / // /
getSchoolData (schoolId) { getSchool (schoolId) {
let data = {
schoolName: '',
provinceId: '',
cityId: ''
}
this.$get(this.api.querySchoolData).then(({ list }) => { this.$get(this.api.querySchoolData).then(({ list }) => {
this.schoolList = list this.schoolList = list
// schoolId // schoolId
@ -1305,6 +1311,8 @@ export default {
this.form.provinceId = item.provinceId this.form.provinceId = item.provinceId
this.getCityData() this.getCityData()
this.form.cityId = item.cityId this.form.cityId = item.cityId
} else {
this.form.schoolId = ''
} }
} }
}).catch(res => { }); }).catch(res => { });
@ -1451,12 +1459,13 @@ export default {
}, 1500) }, 1500)
this.$store.commit('schoolIdData', { schoolId: this.form.schoolId }) this.$store.commit('schoolIdData', { schoolId: this.form.schoolId })
this.$message.success('添加成功') this.$message.success('添加成功')
tab ? this.tabChange(tab, 1) : this.router.push('list') tab ? this.tabChange(tab, 1) : this.$router.push('/customer')
}).catch((res) => { }).catch((res) => {
this.submiting = false this.submiting = false
}) })
} }
} else { } else {
this.submiting = false
this.$message.warning('该客户已存在') this.$message.warning('该客户已存在')
} }
} }

@ -92,7 +92,7 @@
min-width="100" min-width="100"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="realSchool" <el-table-column prop="realSchool"
label="学生所院校" label="学生所院校"
min-width="100" min-width="100"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column v-if="competitionType" <el-table-column v-if="competitionType"
@ -185,7 +185,7 @@
label="学生账号归属" label="学生账号归属"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="realSchool" <el-table-column prop="realSchool"
label="学生所院校" label="学生所院校"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column v-if="competitionType" <el-table-column v-if="competitionType"
prop="teamName" prop="teamName"

@ -146,7 +146,7 @@
<td> <td>
<span v-if="item.score >= 0" <span v-if="item.score >= 0"
class="m-r-10">分数{{item.score}}</span> class="m-r-10">分数{{item.score}}</span>
<el-button v-if="form.completeCompetitionSetup.competitionType || (!form.completeCompetitionSetup.competitionType && item.resultsDetails === 0 && item.reportId)" <el-button v-if="form.completeCompetitionSetup.competitionType || (!form.completeCompetitionSetup.competitionType && item.reportId)"
type="text" type="text"
@click="show(item)">查看成绩详情</el-button> @click="show(item)">查看成绩详情</el-button>
</td> </td>
@ -268,7 +268,7 @@
<td>{{ item.timeSum }}min</td> <td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td> <td>{{ item.score }}</td>
<td> <td>
<el-button v-if="curRow.resultsDetails === 0 && item.reportId" <el-button :disabled="!item.reportId"
type="text" type="text"
@click="toReport(item)">查看</el-button> @click="toReport(item)">查看</el-button>
</td> </td>
@ -278,6 +278,15 @@
<td colspan="6">暂无数据</td> <td colspan="6">暂无数据</td>
</tr> </tr>
</table> </table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize">
</el-pagination>
</div>
<span slot="footer" <span slot="footer"
class="dialog-footer"> class="dialog-footer">
<el-button size="small" <el-button size="small"
@ -289,7 +298,6 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
import Util from "@/libs/util"; import Util from "@/libs/util";
export default { export default {
data () { data () {
@ -316,6 +324,9 @@ export default {
}, },
memberVisible: false, memberVisible: false,
members: [], members: [],
page: 1,
pageSize: 10,
total: 0,
curRow: {}, curRow: {},
teamVisible: false, teamVisible: false,
teams: [], teams: [],
@ -347,17 +358,12 @@ export default {
checkedMember: '', checkedMember: '',
checkedMembers: [], checkedMembers: [],
chooses: [], chooses: [],
timerList: [],
timer: null timer: null
}; };
}, },
mounted () { mounted () {
this.$once('hook:beforeDestroy', function () { this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer) clearInterval(this.timer)
this.timerList.forEach(n => {
clearTimeout(n)
})
this.timerList = []
}) })
this.getData() this.getData()
}, },
@ -400,19 +406,6 @@ export default {
e.participants = participants e.participants = participants
} }
}) })
//
const now = Date.now()
this.form.competitionStage.map(e => {
//
if (!e.resultsDetails) {
const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // +
if (now > endTime) { //
info.stages.find(n => n.stageId == e.stageId).showDetail = 1
} else if (endTime - now < 86400000) { //
this.timerList.push(setTimeout(this.getInfo, endTime - now))
}
}
})
this.info = info this.info = info
}).catch(err => { }); }).catch(err => { });
}, },
@ -619,23 +612,27 @@ export default {
this.chooseVisible = false this.chooseVisible = false
}).catch(res => { }) }).catch(res => { })
}, },
async getMembers () {
try {
const { page } = await this.$post(this.api.stageTeamScoreDetails, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
stageId: this.curRow.stageId,
teamId: this.info.teamId
})
this.members = page.records
this.total = page.total
} catch (e) { }
},
// //
show (row) { show (row) {
// //
if (this.form.completeCompetitionSetup.competitionType) { // if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row this.curRow = row
this.memberVisible = true this.memberVisible = true
const teamId = this.info.teamId if (this.info.teamId) {
if (teamId) { this.getMembers()
this.$post(this.api.frontOfficeCompetitionRanking, {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
isOverallRanking: 0,
teamId
}).then(({ list }) => {
this.members = list
}).catch(res => { })
} else { } else {
this.members = [] this.members = []
} }
@ -643,6 +640,10 @@ export default {
this.toReport(row) this.toReport(row)
} }
}, },
handleCurrentChange (val) {
this.page = val;
this.getMembers()
},
// //
toReport (row) { toReport (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`) this.$router.push(`/matchReport?reportId=${row.reportId}`)

@ -95,7 +95,7 @@
min-width="100" min-width="100"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="realSchool" <el-table-column prop="realSchool"
label="学生所院校" label="学生所院校"
min-width="100" min-width="100"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="timeSum" <el-table-column prop="timeSum"

@ -6,7 +6,8 @@
content="查看报告"></el-page-header> content="查看报告"></el-page-header>
</el-card> </el-card>
<div class="content"> <div class="content"
v-loading="loading">
<div class="text-right"> <div class="text-right">
<el-button type="primary" <el-button type="primary"
@click="exportPage">导出报告</el-button> @click="exportPage">导出报告</el-button>
@ -232,6 +233,7 @@ export default {
}, },
methods: { methods: {
getData () { // getData () { //
this.loading = true
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => { this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => {
this.form = report this.form = report
this.expData = userScores this.expData = userScores
@ -260,7 +262,9 @@ export default {
} else { } else {
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data)) this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
} }
}).catch(res => { }) }).catch(res => {
this.loading = false
})
}, },
// //
handleList (list) { handleList (list) {
@ -283,6 +287,7 @@ export default {
}) })
} }
this.expData = list this.expData = list
this.loading = false
}, },
exportPage () { exportPage () {
const form = Object.assign(this.form, this.infoData) const form = Object.assign(this.form, this.infoData)
@ -340,9 +345,6 @@ samp {
.content { .content {
padding: 16px 40px; padding: 16px 40px;
background: #fff; background: #fff;
&.loading {
padding-top: 30px;
}
.r-title { .r-title {
margin-bottom: 40px; margin-bottom: 40px;
font-size: 24px; font-size: 24px;

@ -74,7 +74,7 @@
min-width="180" min-width="180"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="realSchool" <el-table-column prop="realSchool"
label="学生所院校" label="学生所院校"
min-width="180" min-width="180"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" <el-table-column v-if="info.completeCompetitionSetup.competitionType"
@ -183,7 +183,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="studentAffiliatedInstitutionId" <el-form-item prop="studentAffiliatedInstitutionId"
label="学生所院校"> label="学生所院校">
<el-select v-model="form.studentAffiliatedInstitutionId" <el-select v-model="form.studentAffiliatedInstitutionId"
filterable filterable
style="width: 100%"> style="width: 100%">
@ -440,7 +440,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.initData() this.getData()
this.getInfo() this.getInfo()
this.getTeam() this.getTeam()
}, },

Loading…
Cancel
Save