Browse Source

对接

test
jiangyy 3 years ago
parent
commit
856b2ccbed
  1. BIN
      src/assets/img/party-helper.gif
  2. 654
      src/views/modules/communityParty/calendar/index.vue
  3. 29
      src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue
  4. 7
      src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue

BIN
src/assets/img/party-helper.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

654
src/views/modules/communityParty/calendar/index.vue

@ -1,266 +1,271 @@
<template> <template>
<div class="g-cnt"> <div>
<el-row :gutter="15"> <div v-if="showType==='list'"
<el-col :span="6"> class="g-cnt">
<div class="m-sizer"> <el-row :gutter="15">
<div class="item"> <el-col :span="6">
<el-cascader <div class="m-sizer">
class="customer_cascader" <div class="item">
ref="myCascader" <el-cascader class="customer_cascader"
size="small" ref="myCascader"
v-model="fmData.orgId" size="small"
:options="partyOptions" v-model="fmData.orgId"
:props="partyOptionsProps" :options="partyOptions"
:show-all-levels="false" :props="partyOptionsProps"
@change="handleChangeParty" :show-all-levels="false"
></el-cascader> @change="handleChangeParty"></el-cascader>
</div> </div>
<div class="item"> <div class="item">
<el-radio v-model="fmData.isSelf" label="1" <el-radio v-model="fmData.isSelf"
>本人创建的活动</el-radio label="1">本人创建的活动</el-radio>
> <el-radio v-model="fmData.isSelf"
<el-radio v-model="fmData.isSelf" label="0" label="0">本组织所有活动</el-radio>
>本组织所有活动</el-radio </div>
>
</div> </div>
</div>
<div class="m-date"> <div class="m-date">
<div class="date-top"> <div class="date-top">
{{ currentDate.year }}{{ currentDate.month + 1 }} {{ currentDate.year }}{{ currentDate.month + 1 }}
</div>
<div class="date-big">{{ currentDate.date }}</div>
<div class="date-week">{{ currentDate.dayFormat }}</div>
</div> </div>
<div class="date-big">{{ currentDate.date }}</div>
<div class="date-week">{{ currentDate.dayFormat }}</div>
</div>
<div <div class="m-list"
class="m-list" v-if="
v-if="
currentDateData.activityList.length > 0 || currentDateData.activityList.length > 0 ||
currentDateData.scheduleList.length > 0 currentDateData.scheduleList.length > 0
" ">
> <div class="list-title">今日活动/日程</div>
<div class="list-title">今日活动/日程</div> <div class="list">
<div class="list"> <div class="item"
<div :key="item.activityId"
class="item" v-for="item in currentDateData.activityList">
:key="item.activityId" <div class="item-title">
v-for="item in currentDateData.activityList" {{ item.theme }}
> </div>
<div class="item-title"> <div class="item-prop">
{{ item.theme }} <span>活动类型</span>
</div> <span>{{ item.type }}</span>
<div class="item-prop"> </div>
<span>活动类型</span> <div class="item-prop">
<span>{{ item.type }}</span> <span>开始时间</span>
</div> <span>{{ item.holdTime }}</span>
<div class="item-prop"> </div>
<span>开始时间</span> <div class="item-prop">
<span>{{ item.holdTime }}</span> <span>活动地点</span>
</div> <span>{{ item.address }}</span>
<div class="item-prop"> </div>
<span>活动地点</span> <div class="item-prop">
<span>{{ item.address }}</span> <span>参加组织</span>
</div> <span>{{ item.joinOrgs.join("、") }}</span>
<div class="item-prop"> </div>
<span>参加组织</span> <div class="item-ope">
<span>{{ item.joinOrgs.join("、") }}</span> <el-button type="primary"
size="mini"
@click="handleClickHuodong('publish', item)">发布</el-button>
<el-button type="success"
size="mini"
@click="handleClickHuodong('edit', item)">编辑</el-button>
<el-button size="mini"
@click="handleClickHuodong('del', item)">删除</el-button>
</div>
</div> </div>
<div class="item-ope">
<el-button <div class="item"
type="primary" :key="item.scheduleId"
size="mini" v-for="item in currentDateData.scheduleList">
@click="handleClickHuodong('publish', item)" <div class="item-title">
>发布</el-button {{ item.title }}
> </div>
<el-button <div class="item-prop">
type="success" <span>提醒时间</span>
size="mini" <span>{{ item.remindTime }}</span>
@click="handleClickHuodong('edit', item)" </div>
>编辑</el-button <div class="item-prop">
> <span>备注说明</span>
<el-button size="mini" @click="handleClickHuodong('del', item)" <span>{{ item.remark }}</span>
>删除</el-button </div>
> <div class="item-ope">
<el-button type="success"
size="mini"
@click="handleClickRicheng('edit', item)">编辑</el-button>
<el-button size="mini"
@click="handleClickRicheng('del', item)">删除</el-button>
</div>
</div> </div>
</div> </div>
</div>
<div <div class="m-ope">
class="item" <el-button type="warning"
:key="item.scheduleId" style="width: 48%"
v-for="item in currentDateData.scheduleList" @click="addHudong">添加活动计划</el-button>
> <el-button style="width: 48%"
<div class="item-title"> @click="addRicheng">添加日程</el-button>
{{ item.title }} </div>
</div> </el-col>
<div class="item-prop">
<span>提醒时间</span> <el-col :span="18">
<span>{{ item.remindTime }}</span> <div class="m-cal">
<div class="hd">
<div class="hd-year">
<el-date-picker v-model="currentYearStr"
value-format="yyyy"
type="year"
placeholder="选择年"
size="small"
style="width: 150px">
</el-date-picker>
</div> </div>
<div class="item-prop"> <div class="hd-month">
<span>备注说明</span> <div class="month-item"
<span>{{ item.remark }}</span> :class="{ 'z-on': m - 1 == currentMonth }"
:key="'month' + m"
@click="currentMonth = m - 1"
v-for="m in 12">
<el-badge :value="monthData[m - 1]"
:hidden="monthData[m - 1] == 0"
class="item">
<div class="month-text">{{ m }}</div>
</el-badge>
</div>
</div> </div>
<div class="item-ope"> <div class="hd-btn">
<el-button <el-button type="primary"
type="success" size="small"
size="mini" @click="handleAddYearPlan">批量生成年度报表</el-button>
@click="handleClickRicheng('edit', item)"
>编辑</el-button
>
<el-button size="mini" @click="handleClickRicheng('del', item)"
>删除</el-button
>
</div> </div>
</div> </div>
</div> <calendar :currentYear="currentYear"
</div> :currentMonth="currentMonth"
@rangeChange="handleRangeChange"
<div class="m-ope"> @clickDate="handleChangeDate">
<el-button type="warning" style="width: 48%" @click="addHudong" <template v-slot:date-item="{ item, index }">
>添加活动计划</el-button <div class="tip"
> v-if="
<el-button style="width: 48%" @click="addRicheng">添加日程</el-button>
</div>
</el-col>
<el-col :span="18">
<div class="m-cal">
<div class="hd">
<div class="hd-year">
<el-date-picker
v-model="currentYearStr"
value-format="yyyy"
type="year"
placeholder="选择年"
size="small"
style="width: 150px"
>
</el-date-picker>
</div>
<div class="hd-month">
<div
class="month-item"
:class="{ 'z-on': m - 1 == currentMonth }"
:key="'month' + m"
@click="currentMonth = m - 1"
v-for="m in 12"
>
<el-badge
:value="monthData[m - 1]"
:hidden="monthData[m - 1] == 0"
class="item"
>
<div class="month-text">{{ m }}</div>
</el-badge>
</div>
</div>
<div class="hd-btn">
<el-button type="primary" size="small"
>批量生成年度报表</el-button
>
</div>
</div>
<calendar
:currentYear="currentYear"
:currentMonth="currentMonth"
@rangeChange="handleRangeChange"
@clickDate="handleChangeDate"
>
<template v-slot:date-item="{ item, index }">
<div
class="tip"
v-if="
rangeData[item.dateId] && rangeData[item.dateId] &&
rangeData[item.dateId].activityList.length > 0 rangeData[item.dateId].activityList.length > 0
" ">
> <div class="tip-num"
<div v-if="rangeData[item.dateId].activityList.length > 1">
class="tip-num" {{ rangeData[item.dateId].activityList.length }}
v-if="rangeData[item.dateId].activityList.length > 1" </div>
>
{{ rangeData[item.dateId].activityList.length }}
</div>
<div class="tip-text"> <div class="tip-text">
<span class="z-on"> <span class="z-on">
{{ rangeData[item.dateId].activityList[0].type }}</span {{ rangeData[item.dateId].activityList[0].type }}</span>
> {{
{{
rangeData[item.dateId].activityList[0].isPublicValue rangeData[item.dateId].activityList[0].isPublicValue
? "(已发布)" ? "(已发布)"
: "" : ""
}} }}
</div> </div>
<div class="tip-cnt"> <div class="tip-cnt">
{{ rangeData[item.dateId].activityList[0].topic }} {{ rangeData[item.dateId].activityList[0].topic }}
</div> </div>
<div class="all-list" :class="computeAllListClass(index)"> <div class="all-list"
<div :class="computeAllListClass(index)">
class="item" <div class="item"
:key="item.activityId" :key="item.activityId"
v-for="item in rangeData[item.dateId].activityList" v-for="item in rangeData[item.dateId].activityList">
> <div class="item-title">
<div class="item-title"> {{ item.theme }}
{{ item.theme }} </div>
</div> <div class="item-prop">
<div class="item-prop"> <span>活动类型</span>
<span>活动类型</span> <span>{{ item.type }}</span>
<span>{{ item.type }}</span> </div>
</div> <div class="item-prop">
<div class="item-prop"> <span>开始时间</span>
<span>开始时间</span> <span>{{ item.holdTime }}</span>
<span>{{ item.holdTime }}</span> </div>
</div> <div class="item-prop">
<div class="item-prop"> <span>活动地点</span>
<span>活动地点</span> <span>{{ item.address }}</span>
<span>{{ item.address }}</span> </div>
</div> <div class="item-prop">
<div class="item-prop"> <span>参加组织</span>
<span>参加组织</span> <span>{{ item.joinOrgs.join("、") }}</span>
<span>{{ item.joinOrgs.join("、") }}</span> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="corn"
<div v-if="
class="corn"
v-if="
rangeData[item.dateId] && rangeData[item.dateId] &&
rangeData[item.dateId].scheduleList.length > 0 rangeData[item.dateId].scheduleList.length > 0
" ">
> <div class="corn-num">
<div class="corn-num"> {{ rangeData[item.dateId].scheduleList.length }}
{{ rangeData[item.dateId].scheduleList.length }} </div>
</div> <div class="corn-text">日程</div>
<div class="corn-text">日程</div>
<div class="all-list"
<div class="all-list" :class="computeAllListClass(index)"> :class="computeAllListClass(index)">
<div <div class="item"
class="item" :key="item.scheduleId"
:key="item.scheduleId" v-for="item in rangeData[item.dateId].scheduleList">
v-for="item in rangeData[item.dateId].scheduleList" <div class="item-title">
> {{ item.title }}
<div class="item-title"> </div>
{{ item.title }} <div class="item-prop">
</div> <span>提醒时间</span>
<div class="item-prop"> <span>{{ item.remindTime }}</span>
<span>提醒时间</span> </div>
<span>{{ item.remindTime }}</span> <div class="item-prop">
</div> <span>备注说明</span>
<div class="item-prop"> <span>{{ item.remark }}</span>
<span>备注说明</span> </div>
<span>{{ item.remark }}</span>
</div> </div>
</div> </div>
</div> </div>
</div> </template>
</template> </calendar>
</calendar> </div>
</div> </el-col>
</el-col> </el-row>
</el-row>
</div>
<div v-if="showType==='yearplan'">
<yearplan-list @handleOk="handleAddPlanOk"
@handleClose="handleAddPlanClose"></yearplan-list>
</div>
<el-dialog v-if="showAdd"
:visible.sync="showAdd"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="addDiaTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="showAdd = false">
<add-activity ref="ref_add_form"
:formType="formType"
:icPartyActId="icPartyActId"
@handleOk="handleOk"
@handleClose="handleClose"></add-activity>
</el-dialog>
<el-dialog v-if="showSchedule"
:visible.sync="showSchedule"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="scheduleDiaTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="showSchedule = false">
<schedule-form ref="ref_schedule_form"
:formType="formType"
:scheduleId="scheduleId"
@handleOk="handleOk"
@handleClose="handleClose">
</schedule-form>
</el-dialog>
</div> </div>
</template> </template>
@ -268,8 +273,11 @@
import { requestPost, requestGet } from "@/js/dai/request"; import { requestPost, requestGet } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import calendar from "./cpts/calendar"; 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) => { return new Promise(async (resolve) => {
while (!fn()) { while (!fn()) {
await nextTick(100); await nextTick(100);
@ -282,8 +290,11 @@ export default {
name: "party-calendar", name: "party-calendar",
components: { components: {
calendar, calendar,
yearplanList,
addActivity,
scheduleForm,
}, },
data() { data () {
let todayObj = new Date(); let todayObj = new Date();
return { return {
@ -321,13 +332,23 @@ export default {
isSelf: "1", isSelf: "1",
yearId: "", yearId: "",
}, },
showAdd: false,
formType: 'add',
addDiaTitle: '添加活动计划',
showSchedule: false,
scheduleDiaTitle: '添加日程提醒',
showType: 'list',
icPartyActId: '',
scheduleId: '',
}; };
}, },
computed: { computed: {
currentYear() { currentYear () {
return parseInt(this.currentYearStr); return parseInt(this.currentYearStr);
}, },
apiParams() { apiParams () {
const { currentYear, fmData } = this; const { currentYear, fmData } = this;
return { return {
yearId: currentYear, yearId: currentYear,
@ -352,39 +373,151 @@ export default {
this.getMonthData(); this.getMonthData();
}, },
}, },
async mounted() { async mounted () {
await this.getPartyOptions(); await this.getPartyOptions();
this.getMonthData(); this.getMonthData();
}, },
methods: { 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); console.log(type, item);
this.icPartyActId = item.activityId
if (type == "publish") { 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") { } else if (type == "edit") {
// //
this.addDiaTitle = '修改活动计划'
this.formType = 'edit'
this.showAdd = true
} else if (type == "del") { } 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); console.log(type, item);
this.scheduleId = item.scheduleId
if (type == "edit") { if (type == "edit") {
// //
this.scheduleDiaTitle = '修改日程提醒'
this.formType = 'schedule'
this.showSchedule = true;
} else if (type == "del") { } 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"); console.log("handleChangeDate");
this.currentYearStr = item.year + ""; this.currentYearStr = item.year + "";
this.currentMonth = item.month; this.currentMonth = item.month;
@ -393,7 +526,7 @@ export default {
this.getCurrentDateData(); this.getCurrentDateData();
}, },
computeAllListClass(index) { computeAllListClass (index) {
let x = index % 7; let x = index % 7;
let y = Math.floor(index / 7); let y = Math.floor(index / 7);
if (x < 3) { if (x < 3) {
@ -411,12 +544,12 @@ export default {
} }
}, },
handleRangeChange(arr) { handleRangeChange (arr) {
this.rangeDateList = arr; this.rangeDateList = arr;
this.getRangeData(); this.getRangeData();
}, },
async getRangeData() { async getRangeData () {
const arr = this.rangeDateList; const arr = this.rangeDateList;
const url = "/resi/partymember/icPartyAct/homeSearch"; const url = "/resi/partymember/icPartyAct/homeSearch";
@ -454,7 +587,7 @@ export default {
} }
}, },
async getMonthData() { async getMonthData () {
const url = "/resi/partymember/icPartyAct/homeMonthTotal"; const url = "/resi/partymember/icPartyAct/homeMonthTotal";
if (!this.apiParams.orgId) return; if (!this.apiParams.orgId) return;
@ -474,7 +607,7 @@ export default {
} }
}, },
async getCurrentDateData() { async getCurrentDateData () {
const url = "/resi/partymember/icPartyAct/actAndScheduleList"; const url = "/resi/partymember/icPartyAct/actAndScheduleList";
if (!this.apiParams.orgId) return; if (!this.apiParams.orgId) return;
@ -491,7 +624,7 @@ export default {
} }
}, },
async getPartyOptions() { async getPartyOptions () {
const url = "/resi/partymember/icPartyOrg/getSearchTreelist"; const url = "/resi/partymember/icPartyOrg/getSearchTreelist";
let params = { let params = {
customerId: localStorage.getItem("customerId"), customerId: localStorage.getItem("customerId"),
@ -507,6 +640,29 @@ export default {
} else { } 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()
},
}, },
}; };
</script> </script>

29
src/views/modules/communityParty/orgActivity/activivityList/scheduleForm.vue

@ -117,7 +117,13 @@ export default {
}, },
components: {}, components: {},
async mounted () { 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() 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 () { async handleAdd () {
this.btnDisable = true this.btnDisable = true
@ -164,7 +187,7 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.$message.success('添加成功') this.$message.success('操作成功')
this.resetData() this.resetData()
this.$emit('handleOk') this.$emit('handleOk')
} else { } else {
@ -235,6 +258,10 @@ export default {
type: String, type: String,
required: '' required: ''
}, },
scheduleId: { // addeditdetail,feedback
type: String,
required: ''
},
} }

7
src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue

@ -241,8 +241,8 @@ export default {
computed: { computed: {
maxTableHeight () { maxTableHeight () {
return this.$store.state.inIframe return this.$store.state.inIframe
? this.clientHeight - 410 + this.iframeHeigh ? this.clientHeight - 380 + this.iframeHeigh
: this.clientHeight - 410; : this.clientHeight - 380;
}, },
...mapGetters(["clientHeight", "iframeHeight"]), ...mapGetters(["clientHeight", "iframeHeight"]),
}, },
@ -496,6 +496,7 @@ export default {
.div-btn { .div-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;
padding-bottom: 20px; padding-bottom: 10px;
margin-top: 30px;
} }
</style> </style>

Loading…
Cancel
Save