From 117e51c49fff1b2b7dd0e31e8b8f8a252bcfa580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=B4=A0?= <66666@66.com> Date: Mon, 3 Jun 2024 13:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=A4=BE=E5=8C=BA=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityParty/activity/index.vue | 146 +++++++++++---- .../activity/initiateActivity.vue | 138 ++++++++------- .../communityParty/activity/summDetails.vue | 57 +++--- .../communityParty/comPromotion/event.vue | 166 ++++++++++++++++++ 4 files changed, 384 insertions(+), 123 deletions(-) create mode 100644 src/views/modules/communityParty/comPromotion/event.vue diff --git a/src/views/modules/communityParty/activity/index.vue b/src/views/modules/communityParty/activity/index.vue index 41746a8ff..f848a804e 100644 --- a/src/views/modules/communityParty/activity/index.vue +++ b/src/views/modules/communityParty/activity/index.vue @@ -100,7 +100,7 @@ - + @@ -175,7 +184,8 @@ statuslist: [ { value: 0, label: '未进行' }, { value: 1, label: '进行中' }, - { value: 2, label: '已结束' } + { value: 2, label: '已结束' }, + { value: 3, label: '已取消' } ], typeList:[],//活动类型 corganizerList:[],//协办方list @@ -246,6 +256,8 @@ return '进行中'; case 2: return '已结束'; + case 3: + return '已取消'; default: return ''; } @@ -273,7 +285,7 @@ }, async communityActivityList() { const url = "/actual/base/communityActivity/page"; - + let params = { pageSize: this.pageSize, pageNo: this.pageNo, @@ -281,10 +293,40 @@ ...this.formData, }; let { data, code, msg } = await requestPost(url, params); - if (code === 0) { + if (code === 0) { this.total = data.total this.tableData = data.list - // console.log("datadatadata",this.tableData) + + this.tableData.forEach((item) => { + const currentTime = new Date(); + if (item.startTime > currentTime) { + if( item.status === 0 ){ + return + }else{ + item.status = 0 + this.formData = item; + this.updatetow() + } + } else if (item.startTime < currentTime && item.endTime > currentTime) { + if( item.status === 1 ){ + return + }else{ + item.status = 1 + this.formData = item; + this.updatetow() + } + } else { + if (item.status = 2) { + return + } else { + item.status = 2 + this.formData = item; + this.updatetow() + } + } + }); + + } else { this.$message.error(msg) } @@ -355,7 +397,6 @@ } else { this.$message.error(msg) } - // console.log("饿么么么么么",this.typeList) }, diaClose () { @@ -375,7 +416,6 @@ this.detailShow = false }, summDetailClose () { - // console.log('this.$refs.ref_detail关闭不了为什么') // this.$refs.ref_detail.diaDestroy() this.summShow = false }, @@ -384,30 +424,31 @@ handleDetail (row) { this.detailShow = true this.formTitle = '详情' - + console.log('rowmememmeme',row) this.$nextTick(() => { this.$refs.ref_detail.initForm(row) // this.$refs.ref_form.initForm('detail', row.id) }) }, + + handleEdit (row) { + this.formTitle = '修改' + this.initShow = true + this.$nextTick(() => { + // this.$refs.ref_form.initForm('edit', row.id) + this.$refs.ref_form.initForm('edit', row) + }) + }, + handleSumm(row){ - this.summShow = true + this.initShow = true this.formTitle = '总结' - // console.log('row',row) this.$nextTick(() => { - this.$refs.ref_detail.initForm(row.id) - // this.$refs.ref_form.initForm('detail', row.id) activityImgs sumUp + this.$refs.ref_form.initForm('summary', row) }) + this.communityActivityList() }, - // handleAdd () { - // this.formTitle = '新增' - - // this.formShow = true - // this.$nextTick(() => { - // this.$refs.ref_form.initForm('add', null) - // }) - // }, handleAdd () { this.formTitle = '活动记录' this.initShow = true @@ -424,14 +465,6 @@ // this.$refs.ref_detail.initForm(row) }) }, - handleEdit (row) { - this.formTitle = '修改' - this.initShow = true - this.$nextTick(() => { - // this.$refs.ref_form.initForm('edit', row.id) - this.$refs.ref_form.initForm('edit', row) - }) - }, addFormCancle () { this.formShow = false @@ -469,6 +502,57 @@ }); }, + async handleCancel(row) { + this.$confirm("确认取消?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.update(row) + }) + .catch(err => { + // console.log("hehheheheh",row) + if (err == "cancel") { + + } + + }); + }, + + async update(row) { + let url = '/actual/base/communityActivity/update' + this.formData = row + this.formData.status = 3 + const { data, code, msg, internalMsg } = await requestPost(url, this.formData) + if (code === 0) { + this.$message({ + type: 'success', + message: '操作成功' + }) + + } else if(internalMsg !== ''){ + this.$message.error(internalMsg) + }else{ + this.$message.error(msg) + } + this.resetSearch() + }, + async updatetow(){ + let url = '/actual/base/communityActivity/update' + const { data, code, msg, internalMsg } = await requestPost(url, this.formData) + if (code === 0) { + this.$message({ + type: 'success', + // message: '操作成功' + }) + } else if (internalMsg !== '') { + this.$message.error(internalMsg) + } else { + this.$message.error(msg) + } + this.resetSearch() + }, async deleteActivity (row) { diff --git a/src/views/modules/communityParty/activity/initiateActivity.vue b/src/views/modules/communityParty/activity/initiateActivity.vue index 5d505647b..57d6f3785 100644 --- a/src/views/modules/communityParty/activity/initiateActivity.vue +++ b/src/views/modules/communityParty/activity/initiateActivity.vue @@ -2,75 +2,79 @@
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - -
- - + + + -
-
-
+ - - - + + + + + +
+ + + +
+
+ + +
+ + + + +
+
+
+ + + + +
@@ -204,6 +208,7 @@ export default { loading: false, timeRange: [], online: false, + summary:true, btnDisable: false, @@ -247,7 +252,9 @@ export default { // type, // url: res.data.url // }); + // console.log('this.formData.activityImgs',res.data.url) this.formData.activityImgs.push(res.data.url); + } else { this.$message.error(res.msg); } @@ -407,7 +414,7 @@ export default { }, async initForm(type, activityId) { this.startLoading() - // console.log("啊实打实的", type, activityId) + console.log("啊实打实的", type, activityId) this.$nextTick(() => { if (!map) { @@ -442,6 +449,12 @@ export default { } }else if (type === 'records') { this.records = true + }else if(type === 'summary'){ + this.formData = activityId + this.formData.activityImgs = [] + console.log("this.formData",this.formData) + this.records = true + this.summary = false }else{ this.records = false } @@ -554,7 +567,7 @@ export default { }) }, async addActivity() { - if (this.formType === 'edit') { + if (this.formType === 'edit' || this.formType === 'summary') { let url = '/actual/base/communityActivity/update' const { data, code, msg } = await requestPost(url, this.formData) if (code === 0) { @@ -692,6 +705,7 @@ export default { this.keyWords = '' this.online = false this.formType='' + this.summary=true this.formData = { id: "", typeId: "", diff --git a/src/views/modules/communityParty/activity/summDetails.vue b/src/views/modules/communityParty/activity/summDetails.vue index e90f0ea3d..c6c3c58fb 100644 --- a/src/views/modules/communityParty/activity/summDetails.vue +++ b/src/views/modules/communityParty/activity/summDetails.vue @@ -2,41 +2,38 @@
- - -
- - -
-
- -
- - 最多三张图片 -
-
-
- 照片 -
-
- 暂无照片 -
-
-
+ + +
+ + +
+
+ +
+ + 最多三张图片 +
+
+
+ 照片 +
+
+ 暂无照片 +
+
+
取 消 - 确 + 确 定
diff --git a/src/views/modules/communityParty/comPromotion/event.vue b/src/views/modules/communityParty/comPromotion/event.vue new file mode 100644 index 000000000..7cc5d2512 --- /dev/null +++ b/src/views/modules/communityParty/comPromotion/event.vue @@ -0,0 +1,166 @@ + + + + +