diff --git a/src/assets/img/party-helper.gif b/src/assets/img/party-helper.gif deleted file mode 100644 index 9e03c5238..000000000 Binary files a/src/assets/img/party-helper.gif and /dev/null differ diff --git a/src/views/modules/communityParty/calendar/index.vue b/src/views/modules/communityParty/calendar/index.vue index 308ff3aa1..398a398aa 100644 --- a/src/views/modules/communityParty/calendar/index.vue +++ b/src/views/modules/communityParty/calendar/index.vue @@ -1,266 +1,271 @@ @@ -268,8 +273,11 @@ import { requestPost, requestGet } from "@/js/dai/request"; import nextTick from "dai-js/tools/nextTick"; import calendar from "./cpts/calendar"; +import yearplanList from "../orgActivity/activivityList/yearplanList"; +import addActivity from "../orgActivity/activivityList/addActivity"; +import scheduleForm from "../orgActivity/activivityList/scheduleForm"; -function doAfter(fn) { +function doAfter (fn) { return new Promise(async (resolve) => { while (!fn()) { await nextTick(100); @@ -282,8 +290,11 @@ export default { name: "party-calendar", components: { calendar, + yearplanList, + addActivity, + scheduleForm, }, - data() { + data () { let todayObj = new Date(); return { @@ -321,13 +332,23 @@ export default { isSelf: "1", yearId: "", }, + + showAdd: false, + formType: 'add', + addDiaTitle: '添加活动计划', + showSchedule: false, + scheduleDiaTitle: '添加日程提醒', + showType: 'list', + + icPartyActId: '', + scheduleId: '', }; }, computed: { - currentYear() { + currentYear () { return parseInt(this.currentYearStr); }, - apiParams() { + apiParams () { const { currentYear, fmData } = this; return { yearId: currentYear, @@ -352,39 +373,151 @@ export default { this.getMonthData(); }, }, - async mounted() { + async mounted () { await this.getPartyOptions(); this.getMonthData(); }, methods: { // 添加活动 - addHudong() {}, + addHudong () { + this.icPartyActId = '' + this.addDiaTitle = '新增活动计划' + this.formType = 'add' + this.showAdd = true; + }, + // 添加日程 - addRicheng() {}, + addRicheng () { + this.formType = 'schedule' + this.showSchedule = true; + }, + + // 点击活动操作 - handleClickHuodong(type, item) { + handleClickHuodong (type, item) { console.log(type, item); + this.icPartyActId = item.activityId + if (type == "publish") { // 发布 + this.$confirm("确认发布活动?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.publishActivity() + }) + .catch(err => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消发布" + // }); + } + + }); } else if (type == "edit") { // 编辑 + this.addDiaTitle = '修改活动计划' + this.formType = 'edit' + this.showAdd = true } else if (type == "del") { // 删除 + this.$confirm("活动删除后不可恢复,您确定要删除吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.cancelActivity() + }) + .catch(err => { + if (err == "cancel") { } + }); + + } + }, + + async publishActivity () { + const url = `/resi/partymember/icPartyAct/publish/${this.icPartyActId}`; + + const { data, code, msg } = await requestPost(url, {}); + + if (code === 0) { + this.$message.success("发布成功!"); + this.refreshData(); + } else { + this.$message.error("操作失败!"); + } + }, + + async cancelActivity () { + const url = "/resi/partymember/icPartyAct/del"; + + let params = [] + params.push(this.icPartyActId) + + const { data, code, msg } = await requestPost(url, params); + + if (code === 0) { + this.$message.success("删除成功!"); + this.refreshData(); + } else { + this.$message.error("操作失败!"); } }, + // 点击日程操作 - handleClickRicheng(type, item) { + handleClickRicheng (type, item) { console.log(type, item); + this.scheduleId = item.scheduleId if (type == "edit") { // 编辑 + this.scheduleDiaTitle = '修改日程提醒' + this.formType = 'schedule' + this.showSchedule = true; } else if (type == "del") { // 删除 + this.$confirm("日程提醒删除后不可恢复,您确定要删除吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + this.cancelSchedule() + }) + .catch(err => { + if (err == "cancel") { } + }); + } + }, + + async cancelSchedule () { + + const url = "/resi/partymember/icSchedule/del"; + + let params = [] + params.push(this.scheduleId) + + const { data, code, msg } = await requestPost(url, params); + + if (code === 0) { + this.$message.success("删除成功!"); + this.refreshData(); + } else { + this.$message.error("操作失败!"); } }, - handleChangeParty() {}, + //刷新日历 + refreshData () { - handleChangeDate(item) { + }, + + handleChangeParty () { }, + + handleChangeDate (item) { console.log("handleChangeDate"); this.currentYearStr = item.year + ""; this.currentMonth = item.month; @@ -393,7 +526,7 @@ export default { this.getCurrentDateData(); }, - computeAllListClass(index) { + computeAllListClass (index) { let x = index % 7; let y = Math.floor(index / 7); if (x < 3) { @@ -411,12 +544,12 @@ export default { } }, - handleRangeChange(arr) { + handleRangeChange (arr) { this.rangeDateList = arr; this.getRangeData(); }, - async getRangeData() { + async getRangeData () { const arr = this.rangeDateList; const url = "/resi/partymember/icPartyAct/homeSearch"; @@ -454,7 +587,7 @@ export default { } }, - async getMonthData() { + async getMonthData () { const url = "/resi/partymember/icPartyAct/homeMonthTotal"; if (!this.apiParams.orgId) return; @@ -474,7 +607,7 @@ export default { } }, - async getCurrentDateData() { + async getCurrentDateData () { const url = "/resi/partymember/icPartyAct/actAndScheduleList"; if (!this.apiParams.orgId) return; @@ -491,7 +624,7 @@ export default { } }, - async getPartyOptions() { + async getPartyOptions () { const url = "/resi/partymember/icPartyOrg/getSearchTreelist"; let params = { customerId: localStorage.getItem("customerId"), @@ -507,6 +640,29 @@ export default { } else { } }, + + handleAddYearPlan () { + this.showType = 'yearplan' + }, + + handleAddPlanOk () { + this.showType = 'list' + this.refreshData() + }, + handleAddPlanClose () { + this.showType = 'list' + }, + + handleClose () { + this.formType = '' + this.showAdd = false + this.showSchedule = false + }, + + handleOk () { + this.handleClose() + this.refreshData() + }, }, }; diff --git a/src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue b/src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue index 8b366d438..ef03fd744 100644 --- a/src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue +++ b/src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue @@ -117,7 +117,13 @@ export default { }, components: {}, async mounted () { + if (this.scheduleId) { + this.formData.scheduleId = this.scheduleId + await this.loadInfo() + } else { + this.$refs.ref_form.resetFields(); + } }, @@ -129,6 +135,23 @@ export default { this.handleAdd() }, + async loadInfo () { + const url = `/resi/partymember/icSchedule/${this.scheduleId}`; + // const url = `http://yapi.elinkservice.cn/mock/245/resi/partymember/icPartyAct/act-detail/${this.icPartyActId}`; + + let params = {} + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + this.formData = { ...data } + this.formData.scheduleId = this.scheduleId + + } else { + this.$message.error(msg) + } + }, + async handleAdd () { this.btnDisable = true @@ -164,7 +187,7 @@ export default { const { data, code, msg } = await requestPost(url, params) if (code === 0) { - this.$message.success('添加成功') + this.$message.success('操作成功') this.resetData() this.$emit('handleOk') } else { @@ -235,6 +258,10 @@ export default { type: String, required: '' }, + scheduleId: { //表单操作类型 add新增,edit编辑,detail详情,feedback反馈 + type: String, + required: '' + }, } diff --git a/src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue b/src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue index 148fe6c87..e526b8d25 100644 --- a/src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue +++ b/src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue @@ -241,8 +241,8 @@ export default { computed: { maxTableHeight () { return this.$store.state.inIframe - ? this.clientHeight - 410 + this.iframeHeigh - : this.clientHeight - 410; + ? this.clientHeight - 380 + this.iframeHeigh + : this.clientHeight - 380; }, ...mapGetters(["clientHeight", "iframeHeight"]), }, @@ -496,6 +496,7 @@ export default { .div-btn { display: flex; justify-content: center; - padding-bottom: 20px; + padding-bottom: 10px; + margin-top: 30px; }