From 9744ea85c5be22ee7846d85f3c4740d71d319eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=B4=A0?= <66666@66.com> Date: Fri, 31 May 2024 14:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=A4=BE=E5=8C=BA=E5=AE=A3?= =?UTF-8?q?=E4=BC=A0,=E5=AE=A3=E4=BC=A0=E6=A0=87=E7=AD=BE=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityParty/comPromotion/add.vue | 429 +++++++++++++++--- .../communityParty/comPromotion/event.vue | 166 +++++++ .../communityParty/comPromotion/index.vue | 85 +++- .../workSys/promotionTab/AddpromotionTab.vue | 66 ++- .../modules/workSys/promotionTab/index.vue | 32 +- .../promotionTab/viewPromotionalTags.vue | 31 +- 6 files changed, 671 insertions(+), 138 deletions(-) create mode 100644 src/views/modules/communityParty/comPromotion/event.vue diff --git a/src/views/modules/communityParty/comPromotion/add.vue b/src/views/modules/communityParty/comPromotion/add.vue index f842f340c..db3ce79d1 100644 --- a/src/views/modules/communityParty/comPromotion/add.vue +++ b/src/views/modules/communityParty/comPromotion/add.vue @@ -1,80 +1,375 @@ - + \ No newline at end of file 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 @@ + + + + + diff --git a/src/views/modules/communityParty/comPromotion/index.vue b/src/views/modules/communityParty/comPromotion/index.vue index 44e70b4e0..9e52ce2e3 100644 --- a/src/views/modules/communityParty/comPromotion/index.vue +++ b/src/views/modules/communityParty/comPromotion/index.vue @@ -4,18 +4,18 @@
- + - - + + - + @@ -40,7 +40,7 @@ style="width: 100%"> - + - + + + - + @@ -90,8 +92,8 @@ - + width="950px" top="5vh" class="dialog-h" @closed="eventForm"> +
@@ -100,10 +102,12 @@ import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost, requestGet } from '@/js/dai/request'; import add from "./add.vue"; + import event from "./event.vue"; export default { data () { return { tableData:[], + unitList:[], loading: false, total: 0, pageSize: 10, @@ -116,10 +120,23 @@ formShow: false, formTitle: '新增活动', detailShow: false, + formData: { + title: "", + tagId: "", + startTime: "", + endTime: "", + }, + pageSize: 20, + pageNo: 1, + adverTagList:[], + statuslist: [ + { value: 0, label: '已发布' }, + { value: 1, label: '已下线' }, + ], } }, components: { - add + add,event }, // components: { // typeActivityadd, typeDetails @@ -135,8 +152,7 @@ this.agencyId = user.agencyId //获取建联单位 - // this.loadUnit() - // this.loadGrid() + this.advertisingTag() //获取网格下拉框数据 this.loadTable() }, @@ -145,22 +161,35 @@ handleSearch () { this.loadTable() }, + async advertisingTag () { + const url = "/actual/base/advertisingTag/page" + let params = { + pageSize: this.pageSize, + pageNo: this.pageNo, + tagName: "", + status: "" + } + const { data, code, msg } = await requestPost(url, params) + if (code === 0) { + this.adverTagList = data.list + } else { + this.$message.error(msg) + } + }, async loadTable () { this.tableLoading = false const url = "/actual/base/communityPublicity/page" let params = { - pageSize: 20, - pageNo: 1, - title: "", - tagId: "", - startTime: "", - endTime: "" + pageSize: this.pageSize, + pageNo: this.pageNo, + // agencyId: this.agencyId, + ...this.formData, } const { data, code, msg } = await requestPost(url, params) if (code === 0) { this.total = data.total this.tableData = data.list - console.log( this.tableData ) + // console.log( "啊大苏打撒旦",this.tableData ) } else { this.$message.error(msg) } @@ -181,7 +210,7 @@ }, detailClosed () { - console.log(this.$refs.ref_detail) + // console.log(this.$refs.ref_detail) // this.$refs.ref_detail.diaDestroy() this.detailShow = false }, @@ -208,14 +237,15 @@ this.formTitle = '修改' this.formShow = true this.$nextTick(() => { - this.$refs.ref_form.initForm(row) + this.$refs.ref_form.initForm("edit",row) }) }, addFormCancle () { this.formShow = false }, - addFormQ(){ + + eventForm(){ this.detailShow = false }, addFormOk () { @@ -256,7 +286,7 @@ }); }, async OnhandleOnline(row){ - console.log(row) + // console.log(row) const url = "/actual/base/communityPublicity/updateStatus" let params={ status:0, @@ -291,7 +321,7 @@ }); }, async OnhandleOffline(row){ - console.log(row) + // console.log(row) const url = "/actual/base/communityPublicity/updateStatus" let params={ status:1, @@ -331,7 +361,12 @@ //重置搜索条件 resetSearch () { - this.typeName = '' + this.formData = { + title: "", + tagId: "", + startTime: "", + endTime: "", + }, this.loadTable() }, diff --git a/src/views/modules/workSys/promotionTab/AddpromotionTab.vue b/src/views/modules/workSys/promotionTab/AddpromotionTab.vue index 4d9921c88..9ec56bdba 100644 --- a/src/views/modules/workSys/promotionTab/AddpromotionTab.vue +++ b/src/views/modules/workSys/promotionTab/AddpromotionTab.vue @@ -5,12 +5,16 @@ - +
- +
+ + + +
@@ -43,9 +47,11 @@ export default { data () { return { - typeName: '', + tagName: '', marde:'', - id:'' + id:'', + status:null, + online:false } @@ -57,12 +63,29 @@ }, methods: { + handleOnlineRegistration(value) { + // console.log(value) + if (value) { + this.online = true; + this.status = 0; + } else { + this.online = false; + this.status = 1; + } + }, async initForm(activityId){ console.log('activityIddetailShow',activityId) if(activityId !== ''){ this.marde = 'edi' this.id = activityId.id - this.typeName = activityId.typeName + this.tagName = activityId.tagName + if(activityId.status === 0){ + this.online = true + }else { + this.online = false + } + + } }, async handleComfirm () { @@ -70,8 +93,8 @@ setTimeout(() => { // this.btnDisable = false }, 100) - if (this.typeName === '') { - this.$message.error('活动类型不能为空') + if (this.tagName === '') { + this.$message.error('标签名称不能为空') }else { this.addActivity() } @@ -79,12 +102,12 @@ }, async addActivity () { if (this.marde === 'edi') { - let url = '/actual/base/activityType/save' + let url = '/actual/base/advertisingTag/update' let parmer = { - tagName:this.typeName, - status: 0, + tagName:this.tagName, + status: this.status, } - const { data, code, msg } = await requestPost(url, parmer) + const { data, code, msg, internalMsg } = await requestPost(url, parmer) if (code === 0) { this.$message({ @@ -94,19 +117,20 @@ this.resetData() this.$emit('dialogOk') // this.btnDisable = false - } else { + } else if(internalMsg !== ''){ // this.btnDisable = false + this.$message.error(internalMsg) + }else{ this.$message.error(msg) } }else{ - let url = '/actual/base/activityType/save' - // let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/save" + let url = '/actual/base/advertisingTag/save' let parmer = { - typeName: this.typeName, - enabled: 0 + tagName: this.tagName, + status: this.status } - const { data, code, msg } = await requestPost(url, parmer) + const { data, code, msg, internalMsg } = await requestPost(url, parmer) if (code === 0) { this.$message({ @@ -116,8 +140,10 @@ this.resetData() this.$emit('dialogOk') // this.btnDisable = false - } else { + } else if(internalMsg !== ''){ // this.btnDisable = false + this.$message.error(internalMsg) + }else{ this.$message.error(msg) } } @@ -133,8 +159,10 @@ }, resetData () { - this.typeName = '', + this.tagName ='' + this.status = null this.marde = '' + this.online = false }, // 开启加载动画 diff --git a/src/views/modules/workSys/promotionTab/index.vue b/src/views/modules/workSys/promotionTab/index.vue index 5213b133b..c3a557a0f 100644 --- a/src/views/modules/workSys/promotionTab/index.vue +++ b/src/views/modules/workSys/promotionTab/index.vue @@ -6,13 +6,13 @@ - + - - + + @@ -34,15 +34,15 @@ 新增 - - + @@ -75,7 +75,7 @@ - @@ -103,10 +103,17 @@ gridList: [],//所属网格 typeName:'', enabled:'', + tableData:[], //form相关 formShow: false, formTitle: '新增活动', detailShow: false, + tagName:'', + status:null, + statuslist: [ + { value: 0, label: '显示' }, + { value: 1, label: '不显示' } + ], } }, components: { @@ -139,12 +146,12 @@ //展示表格 async loadTable () { this.tableLoading = false - const url = "/actual/base/activityType/page" + const url = "/actual/base/advertisingTag/page" let params = { pageSize: 20, pageNo: 1, - tagName: "", - status: 0 + tagName: this.tagName, + status: this.status } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -227,7 +234,7 @@ async deleteActivity (row) { console.log(row) - const url = "/actual/base/activityType/delete" + const url = "/actual/base/advertisingTag/delete" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete" let idArr=[row.id] const { data, code, msg } = await requestPost(url, idArr) @@ -246,7 +253,8 @@ //重置搜索条件 resetSearch () { - this.typeName = '' + this.tagName = '' + this.status = null this.loadTable() }, diff --git a/src/views/modules/workSys/promotionTab/viewPromotionalTags.vue b/src/views/modules/workSys/promotionTab/viewPromotionalTags.vue index 71eb552fb..5506f40b9 100644 --- a/src/views/modules/workSys/promotionTab/viewPromotionalTags.vue +++ b/src/views/modules/workSys/promotionTab/viewPromotionalTags.vue @@ -3,12 +3,14 @@
-
- {{ typeName }} + {{ tagName }}
+ + +
@@ -37,7 +39,8 @@ export default { data () { return { - typeName: '' + tagName: '', + online:false } }, @@ -56,24 +59,22 @@ }, resetData() { - this.typeName = '', + this.tagName = '', this.marde = '' + this.online = false }, async handleComfirm() { - // this.btnDisable = true - // setTimeout(() => { - // // this.btnDisable = false - // }, 100) - // if (this.typeName === '') { - // this.$message.error('活动类型不能为空') - // } else { - // this.addActivity() - // } }, async initForm(activityId) { - this.typeName = activityId.typeName + this.tagName = activityId.tagName + console.log("asdasd ",activityId) + if(activityId.status === 0){ + this.online = true + }else{ + this.online = false + } }, handleComfirm() { // this.resetData() @@ -81,7 +82,7 @@ }, resetData() { - this.typeName = '' + this.tagName = '' }, // 开启加载动画