From 7f1c4ef6667415e3b18891ade9eac06e42ccc9f9 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 26 Jun 2023 16:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=81=E8=B5=9B=E4=BA=8B?= =?UTF-8?q?=E6=8E=92=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/setting.js | 2 +- src/utils/api.js | 1 + src/views/match/manage/matchRank.vue | 45 +++++++++------------------- src/views/order/AddOrder.vue | 37 +++++++++++------------ src/views/serve/addModel.vue | 3 +- 5 files changed, 35 insertions(+), 53 deletions(-) diff --git a/src/setting.js b/src/setting.js index a2f3080..8550266 100644 --- a/src/setting.js +++ b/src/setting.js @@ -11,7 +11,7 @@ if (isDev) { jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 host = 'http://121.37.12.51/' // host = 'https://huorantech.cn/' - // host = 'http://192.168.31.152:9000/'// 榕 + host = 'http://192.168.31.152:9000/'// 榕 // host = 'http://192.168.31.51:9000/'// 赓 } else if (isPro) { jumpPath = 'https://www.huorantech.cn/judgmentPoint/' diff --git a/src/utils/api.js b/src/utils/api.js index 5565b4b..8563a69 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -407,6 +407,7 @@ export default { addCompetitionStageRankingTime: `competition/competitionReleaseTime/addCompetitionStageRankingTime`, cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`, getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`, + frontOfficeCompetitionRanking: `competition/competition/rank/frontOfficeCompetitionRanking`, gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`, rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`, rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`, diff --git a/src/views/match/manage/matchRank.vue b/src/views/match/manage/matchRank.vue index 43b470d..4a2c293 100644 --- a/src/views/match/manage/matchRank.vue +++ b/src/views/match/manage/matchRank.vue @@ -356,7 +356,7 @@ export default { publicationType: this.type, locationStageId: this.stageId, stageIds: ids.splice(0, ids.length - 1) - }).then(({ page, publishStatus }) => { + }).then(({ page, publishStatus, total }) => { this.published = publishStatus this.list = page this.total = total @@ -392,13 +392,7 @@ export default { // 排序类型切换回调 typeChange (val) { this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).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 }) => { - // if (whetherToPublish && !val) this.sourceType = '0' this.getRank() - // this.published = whetherToPublish - // }).catch(res => {}) }, initData () { this.page = 1 @@ -499,12 +493,10 @@ export default { }, // 发布排名 publishSubmit () { - const { startTime, endTime } = this.grades[this.index] - if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') if (this.type) { // 手动发布 this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { - this.getData() - util.successMsg('发布成功!') + // this.getData() + // util.successMsg('发布成功!') }).catch(res => { }) } else { let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data @@ -533,27 +525,14 @@ export default { // this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { this.$post(this.api.publishRanking, data).then(res => { this.uploadData = [] - this.getData() - util.successMsg('发布成功!') + // this.getData() + // util.successMsg('发布成功!') }).catch(res => { }) // }).catch(res => {}) } }, // 发布排名确认 publish () { - // 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 - // if (this.published && this.sourceType != this.type) { - // this.$confirm(this.sourceType == 1 && !this.type ? - // '手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' : - // '默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', { - // type: 'success' - // }).then(() => { - // this.publishSubmit() - // }).catch(() => {}) - // } else { - // this.publishSubmit() - // } - this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { whetherToPublish ? this.$confirm('排名已经发布,是否直接覆盖?', '提示', { @@ -563,7 +542,6 @@ export default { }).catch(() => { }) : this.publishSubmit() }).catch(res => { }) - // this.publishSubmit() }, // 获取定时发布排名 async getPublishTime () { @@ -585,13 +563,18 @@ export default { }, // 定时发布排名 async publishTimeSubmit () { - this.$post(this.api.addCompetitionStageRankingTime, { + const { startTime, endTime } = this.grades[this.index] + if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') + + this.publishSubmit() + await this.$post(this.api.addCompetitionStageRankingTime, { competitionId: this.id, isOverallRanking: this.active ? 0 : 1, publicationType: this.type, stageId: this.active || this.stageId, releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) }) + util.successMsg('发布成功') this.getData() this.uploaded = 0 @@ -609,7 +592,7 @@ export default { // 如果是取消发布,则直接调取消发布的接口 if (publish) { // 如果是手动发布,并且没有上传排名,则提示 - if (this.type && !this.uploaded) { + if (this.type && !this.uploaded && !this.list.length) { return util.errorMsg('请先上传数据!') } else { this.publishTime = new Date() @@ -619,9 +602,9 @@ export default { try { // 取消定时发布的接口跟取消普通发布的接口不一样 // if (this.timeId) { - await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) + // await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) // } else { - await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`) + await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`) // } this.sourceType = '' this.type = 0 diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index c26fefa..4085cf1 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -2015,7 +2015,8 @@ export default { profit: form.profit, purchaseCost: form.purchaseCost, businessManagerId: form.businessManagerId ? +form.businessManagerId : '', - businessManagerName: form.businessManagerName + businessManagerName: form.businessManagerName, + notification: form.notification }; this.$nextTick(() => { form.provinceId && this.getCityData() @@ -2030,7 +2031,8 @@ export default { this.$post(this.api.renew, { authority: 1, customerId, - productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId) + productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId), + mallId: orderOther.filter(e => e.authority === 1).map(e => e.mallId), }).then(({ orderOthers }) => { list.push(...orderOthers) resolve() @@ -2042,7 +2044,8 @@ export default { this.$post(this.api.renew, { authority: 0, customerId, - productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId) + productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId), + mallId: orderOther.filter(e => !e.authority).map(e => e.mallId), }).then(({ orderOthers }) => { list.push(...orderOthers) resolve() @@ -2054,7 +2057,8 @@ export default { this.$post(this.api.renew, { authority: 2, customerId, - productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId) + productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId), + mallId: orderOther.filter(e => e.authority === 2).map(e => e.mallId), }).then(({ orderOthers }) => { list.push(...orderOthers) resolve() @@ -2066,7 +2070,8 @@ export default { this.$post(this.api.renew, { authority: 3, customerId, - productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId) + productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId), + mallId: orderOther.filter(e => e.authority === 3).map(e => e.mallId), }).then(({ orderOthers }) => { list.push(...orderOthers) resolve() @@ -2079,19 +2084,8 @@ export default { authority: 4, // authority: 3, customerId, - productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId) - }).then(({ orderOthers }) => { - list.push(...orderOthers) - resolve() - }).catch(err => { }) - })) - } - if (orderOther.find(e => e.authority === 5)) { - promises.push(new Promise((resolve, reject) => { - this.$post(this.api.renew, { - authority: 5, - customerId, - productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId) + productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId), + mallId: orderOther.filter(e => e.authority === 4).map(e => e.mallId), }).then(({ orderOthers }) => { list.push(...orderOthers) resolve() @@ -2586,11 +2580,13 @@ export default { }) }; const productId = [] + const mallId = [] this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值 e.associatedProduct && productId.push(+e.associatedProduct); + mallId.push(e.mallId) let find = this[name].some(i => e.mallId === i.mallId);// 判断已有的相同的id不进行处理 if (!find) { - // 查询产品管理设置的平台结算价 + // 查询产品管理设置的平台结算价 this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { const mall = res.mallPrice if (mall) { @@ -2608,7 +2604,8 @@ export default { productId.length && await this.$post(this.api.renew, { authority, customerId: this.form.customerId, - productId + productId, + mallId }).then(res => { this[name].map(e => { res.orderOthers.map(el => { diff --git a/src/views/serve/addModel.vue b/src/views/serve/addModel.vue index 48fac84..7e7ffaf 100644 --- a/src/views/serve/addModel.vue +++ b/src/views/serve/addModel.vue @@ -163,8 +163,9 @@ export default { modelName, modelDemo, postStatus, - founder: this.isSchool ? 1 : 0 + founder: this.isSchool ? 1 : 0, } + if (this.isSchool) data.isAdmin = 1 if (id) { data.id = id this.$post(this.api.updateSysModelDemo, data).then(res => {