-
8
+
+
+ {{ rangeData[item.dateId].scheduleList.length }}
+
日程
@@ -132,11 +226,36 @@ export default {
return {
currentYearStr: todayObj.getFullYear() + "",
currentMonth: todayObj.getMonth(),
+ currentDate: {
+ year: "",
+ month: "",
+ date: "",
+ day: "",
+ },
+
+ currentDateData: {
+ scheduleList: [],
+ activityList: [],
+ },
+
+ monthData: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+
+ rangeData: {},
partyOptions: [],
+ partyOptionsProps: {
+ multiple: false,
+ value: "id",
+ label: "partyOrgName",
+ children: "children",
+ checkStrictly: true,
+ emitPath: false,
+ },
fmData: {
- party: "",
+ orgId: "",
+ isSelf: "1",
+ yearId: "",
},
};
},
@@ -144,28 +263,153 @@ export default {
currentYear() {
return parseInt(this.currentYearStr);
},
+ apiParams() {
+ const { currentYear, fmData } = this;
+ return {
+ yearId: currentYear,
+ orgId: fmData.orgId,
+ isSelf: fmData.isSelf,
+ };
+ },
+ },
+ watch: {
+ "fmData.orgId": function (val) {
+ console.log("orgId", val);
+ this.getCurrentDateData();
+ },
+ "fmData.isSelf": function (val) {
+ console.log("isSelf", val);
+ this.getCurrentDateData();
+ },
+ currentYear: function (val) {
+ console.log("watch--currentYear", val);
+ this.getMonthData();
+ },
},
async mounted() {
- // await this.getPartyOggList()
+ this.getPartyOptions();
+ this.getMonthData();
},
methods: {
+ // 添加活动
+ addHudong() {},
+ // 添加日程
+ addRicheng() {},
+ // 点击活动操作
+ handleClickHuodong(type, item) {
+ console.log(type, item);
+ if (type == "publish") {
+ // 发布
+ } else if (type == "edit") {
+ // 编辑
+ } else if (type == "del") {
+ // 删除
+ }
+ },
+ // 点击日程操作
+ handleClickRicheng(type, item) {
+ console.log(type, item);
+ if (type == "edit") {
+ // 编辑
+ } else if (type == "del") {
+ // 删除
+ }
+ },
+
handleChangeParty() {},
handleChangeDate(item) {
console.log("handleChangeDate");
this.currentYearStr = item.year + "";
this.currentMonth = item.month;
+ this.currentDate = { ...item };
+
+ this.getCurrentDateData();
+ },
+
+ handleRangeChange(arr) {
+ this.getRangeData(arr);
+ },
+
+ async getRangeData(arr) {
+ const url = "/icPartyAct/homeSearch";
+
+ const { data, code, msg } = await requestPost(url, {
+ ...this.apiParams,
+ startDate: arr[0].dateId,
+ endDate: arr[arr.length - 1].dateId,
+ });
+ if (code === 0) {
+ if (Array.isArray(data)) {
+ arr.forEach((item) => {
+ this.rangeData[item.dateId] = {
+ ...item,
+ scheduleTotal: 0,
+ activityTotal: 0,
+ scheduleList: [],
+ activityList: [],
+ };
+ let curr = data.find((val) => val.dateId == item.dateId);
+ if (curr) {
+ this.rangeData[item.dateId].scheduleList = curr.scheduleList;
+ this.rangeData[item.dateId].activityList = curr.activityList;
+ this.rangeData[item.dateId].scheduleTotal = curr.scheduleTotal;
+ this.rangeData[item.dateId].activityTotal = curr.activityTotal;
+ }
+ });
+ console.log("rangeData", this.rangeData);
+ }
+ } else {
+ this.$message.error(msg);
+ }
+ },
+
+ async getMonthData() {
+ const url = "/icPartyAct/homeMonthTotal";
+
+ const { data, code, msg } = await requestPost(url, {
+ ...this.apiParams,
+ });
+ if (code === 0) {
+ if (Array.isArray(data)) {
+ data.forEach((item) => {
+ this.monthData[item.monthId - 1] = item.count;
+ });
+ console.log(this.monthData);
+ }
+ } else {
+ this.$message.error(msg);
+ }
+ },
+
+ async getCurrentDateData() {
+ const url = "/icPartyAct/actAndScheduleList";
+
+ const { data, code, msg } = await requestPost(url, {
+ ...this.apiParams,
+ dateId: this.currentDate.dateId,
+ });
+ if (code === 0) {
+ this.currentDateData.scheduleList = data.scheduleList || [];
+ this.currentDateData.activityList = data.activityList || [];
+ } else {
+ this.$message.error(msg);
+ }
},
- async getPartyOggList() {
+ async getPartyOptions() {
const url = "/resi/partymember/icPartyOrg/getSearchTreelist";
let params = {
- agencyId: this.$store.state.user.agencyId,
+ customerId: localStorage.getItem("customerId"),
+ agencyId: localStorage.getItem("agencyId"),
};
+
const { data, code, msg } = await requestGet(url, params);
- console.log("data-orgparty----o", data);
if (code === 0) {
- this.partyOrgList = this.deepArrTOnull(data);
+ if (Array.isArray(data) && data.length > 0) {
+ this.partyOptions = data;
+ this.fmData.orgId = data[0].id;
+ }
} else {
}
},
@@ -237,6 +481,21 @@ $red: #f33;
border-radius: 4px;
cursor: pointer;
color: #999999;
+ .tip-num {
+ position: absolute;
+ z-index: 10;
+ top: -7px;
+ right: -7px;
+ border-radius: 100%;
+ width: 14px;
+ height: 14px;
+ line-height: 14px;
+ text-align: center;
+ font-size: 10px;
+ text-align: center;
+ color: #ffffff;
+ background-color: #f1ba06;
+ }
.z-on {
color: $red;
}