@@ -193,7 +193,8 @@ export default {
identification: 1
},
originForm: {},
- exitMember: 0
+ exitMember: 0,
+ schoolDisable: false
};
},
watch: {
@@ -207,7 +208,6 @@ export default {
mounted() {
this.initData()
this.getInfo()
- this.getClient()
this.getTeam()
},
methods: {
@@ -231,6 +231,13 @@ export default {
getInfo() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
+ // 非本校内则查询接口获取学校列表
+ if (competition.competitionScope) {
+ this.getClient()
+ } else {
+ this.schoolDisable = true
+ this.form.schoolId = competition.schoolId
+ }
}).catch(err => {})
},
initData() {
@@ -288,12 +295,12 @@ export default {
},
// 新增编辑人员
submitForm() {
+ if (this.exitMember) {
+ this.submiting = false
+ return util.errorMsg('学生已存在')
+ }
const { form } = this
if (!this.isAdd) { // 编辑
- if (this.exitMember) {
- this.submiting = false
- return util.errorMsg('学生已存在')
- }
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
@@ -332,7 +339,7 @@ export default {
})
} else {
// 新增人员后再调加入团队的接口
- this.$post(this.api.joinCompetitionTeam, {
+ this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
accountId: form.id,
competitionId: this.id,
teamId: this.form.teamId,
@@ -399,9 +406,15 @@ export default {
},
// 获取客户
getClient() {
- this.$get(this.api.querySchoolData).then(({ list }) => {
- this.clients = list
- }).catch(res => {})
+ if (this.info.competitionScope === 2) { // 指定范围
+ this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => {
+ this.clients = schools
+ }).catch(res => {})
+ } else { // 本校内查询所有学校
+ this.$get(this.api.querySchoolData).then(({ list }) => {
+ this.clients = list
+ }).catch(res => {})
+ }
},
// 获取团队列表
getTeam() {
diff --git a/src/views/serve/projectAdd.vue b/src/views/serve/projectAdd.vue
index 1fb8a5f..5043fbf 100644
--- a/src/views/serve/projectAdd.vue
+++ b/src/views/serve/projectAdd.vue
@@ -342,6 +342,7 @@ export default {
if (!this.isToPoint) {
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res;
+ if (!projectManage.remark) projectManage.remark = projectManage.projectName // 如果没有备注,则直接显示项目名称
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentVos;
this.oriPer = projectManage.permissions
@@ -349,6 +350,7 @@ export default {
e.sort = i + 1;
});
this.$nextTick(() => {
+ this.updateTime = 0
this.$refs.main.scrollTop = 0;
});
}).catch(err => {
@@ -757,7 +759,7 @@ export default {
// 返回
back() {
// 更改了信息才需要提示
- if(this.updateTime > 1){
+ if(this.updateTime){
this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning"
}).then(() => {