diff --git a/src/views/match/manage/matchRank.vue b/src/views/match/manage/matchRank.vue index e09d934..e202a41 100644 --- a/src/views/match/manage/matchRank.vue +++ b/src/views/match/manage/matchRank.vue @@ -311,7 +311,8 @@ export default { let second = data.getSeconds(); return [`${hour}:${minute}:${second} - 23:59:59`] })(), - } + }, + uploaded: 0 }; }, mounted () { @@ -320,35 +321,6 @@ export default { methods: { // 获排名 getData () { - // 查询是否已经发布排名 - // this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => { - // const ids = this.grades.map(e => e.stageId) - // ids.pop() - // // 如果已发布,查询发布上一次排名的来源——>默认顺序或者手动发布(返回数据:是否手动发布(1为是,0不是)) - // whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => { - // this.sourceType = source - // this.type = source == 1 ? 1 : 0 - // }).catch(res => {}) - // this.published = whetherToPublish - // this.getRank(whetherToPublish) - // }).catch(res => {}) - - - - // this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { - // const ids = this.grades.map(e => e.stageId) - // ids.pop() - // // 如果已发布,查询发布上一次排名的来源——>默认顺序或者手动发布(返回数据:是否手动发布(1为是,0不是)) - // whetherToPublish ? - // this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => { - // this.sourceType = source - // this.type = source == 1 ? 1 : 0 - // this.getRank(whetherToPublish) - // }).catch(res => {}) : - // this.getRank() - // this.published = whetherToPublish - // }).catch(res => {}) - this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => { this.sourceType = source this.type = source == 1 ? 1 : 0 @@ -605,6 +577,10 @@ export default { this.published = true this.timeId = res.releaseTime.id this.publishTime = res.releaseTime.releaseTime + } else { + this.published = false + this.timeId = '' + this.publishTime = '' } }, // 定时发布排名 @@ -618,6 +594,7 @@ export default { }) util.successMsg('发布成功') this.getData() + this.uploaded = 0 this.publishVisible = false }, // 取消发布排名 @@ -631,8 +608,13 @@ export default { // 如果是发布排名,则先删除已发布的排名,再调发布排名的接口 // 如果是取消发布,则直接调取消发布的接口 if (publish) { - this.publishTime = new Date() - this.publishVisible = true + // 如果是手动发布,并且没有上传排名,则提示 + if (this.type && !this.uploaded) { + return util.errorMsg('请先上传数据!') + } else { + this.publishTime = new Date() + this.publishVisible = true + } } else { try { // 取消定时发布的接口跟取消普通发布的接口不一样 @@ -675,6 +657,7 @@ export default { }, uploadSuccess (res, file, fileList) { this.uploadFaild = false + this.uploaded = 0 if (res.status === 200) { const { exportCode } = res.data if (exportCode) { @@ -682,6 +665,7 @@ export default { this.uploadFaild = true util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) } else { + this.uploaded = 1 this.importVisible = false this.getRank() util.successMsg('请检查数据后,点击发布排名以发布数据!') diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 88452ee..26d8b7b 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -1682,7 +1682,7 @@ trigger="click">
产品链接 @@ -2854,7 +2854,7 @@ export default { this.shipVisible = true }, copyLink () { - this.shipContent += this.shipInfo + if (!this.viewDisabled) this.shipContent += this.shipInfo }, // 发货信息弹框提交 submitShip () { diff --git a/src/views/serve/addModel.vue b/src/views/serve/addModel.vue index ae452d2..c73f306 100644 --- a/src/views/serve/addModel.vue +++ b/src/views/serve/addModel.vue @@ -40,7 +40,8 @@ + clearable + :disabled="isSchool">
@@ -63,6 +64,7 @@ export default { categoryId: Number(this.$route.query.categoryId), id: Number(this.$route.query.id), postStatus: Number(this.$route.query.postStatus), + isSchool: this.$route.query.isSchool == 1 ? true : false, // 是否院校创建 isDetail: Boolean(this.$route.query.show), // 是否是查看 isModel: Boolean(this.$route.query.model), // 是否是从模型列表进来的,模型和源模型查询详情的接口不一样 categoryIdCus: [], @@ -159,7 +161,7 @@ export default { modelName, modelDemo, postStatus, - founder: 0 + founder: this.isSchool ? 1 : 0 } if (id) { data.id = id diff --git a/src/views/serve/backstage/sourceModel.vue b/src/views/serve/backstage/sourceModel.vue index da8dffa..903cd65 100644 --- a/src/views/serve/backstage/sourceModel.vue +++ b/src/views/serve/backstage/sourceModel.vue @@ -246,7 +246,7 @@ export default { }, // 编辑 edit (row) { - this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}`) + this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&postStatus=${row.postStatus}&isSchool=${this.isSchool}`) }, // 复制 copy (row) { diff --git a/src/views/serve/backstage/sourceType.vue b/src/views/serve/backstage/sourceType.vue index 0ce1676..1339d77 100644 --- a/src/views/serve/backstage/sourceType.vue +++ b/src/views/serve/backstage/sourceType.vue @@ -3,6 +3,7 @@
{ - const { data } = res + this.$post(this.api.sourceModelClassification + '?founder=0').then(({ data }) => { this.orgList = data this.$parent.categories = data data.length && this.$nextTick(() => { - const categoryId = this.$route.query.categoryId - this.$refs.tree.setCurrentKey(categoryId || data[0].id) + const { categoryId, school } = this.$route.query + if (school == 1) { + this.schoolActive = +school + } else { + this.$refs.tree.setCurrentKey(categoryId || data[0].id) + } this.$router.push({ path: 'backstage', query: { ...this.$route.query, - categoryId: this.$refs.tree.getCurrentKey() + categoryId: this.$refs.tree.getCurrentKey(), + school } }).catch(err => { }) - this.$emit('getData') + this.$emit('initData', +school) }) }).catch(res => { }) }, @@ -109,7 +114,8 @@ export default { path: 'backstage', query: { ...this.$route.query, - categoryId: this.$refs.tree.getCurrentKey() + categoryId: this.$refs.tree.getCurrentKey(), + school: 0 } }).catch(err => { }) this.$emit('initData') @@ -118,6 +124,13 @@ export default { schoolClick () { this.$refs.tree.setCurrentKey(null) this.schoolActive = true + this.$router.push({ + path: 'backstage', + query: { + ...this.$route.query, + school: 1 + } + }).catch(err => { }) this.$emit('initData', 1) }, // 添加分类 @@ -190,6 +203,7 @@ export default { padding: 3px 5px 3px 23px; margin-top: 5px; font-size: 14px; + color: #606266; cursor: pointer; &.active { background-color: #f0f7ff;