Browse Source

路演管理 研究员路演统计;公开会议总览

hbchen 11 months ago
parent
commit
c9d54a39e6

File diff suppressed because it is too large
+ 474 - 541
src/components/calendar.vue


+ 21 - 12
src/router/modules/roadShowRoutes.js

@@ -24,16 +24,22 @@ export default [
 			// 	name: "我的日历",
 			// 	component: () => import('@/views/roadshow_manage/myCalendar.vue')
 			// },
-			// {
-			// 	path: "meetingCalendar",
-			// 	name: "公开会议总览",
-			// 	component: () => import('@/views/roadshow_manage/meetingCalendar.vue')
-			// },
-			// {
-			// 	path: "statisticResearcher",
-			// 	name: "研究员路演统计",
-			// 	component: () => import('@/views/roadshow_manage/statistics/researcher.vue')
-			// },
+			{
+				path: "meetingCalendar",
+				name: "meetingCalendar",
+				component: () => import('@/views/roadshow_manage/meetingCalendar.vue'),
+				meta:{
+					title:'公开会议总览'
+				}
+			},
+			{
+				path: "statisticResearcher",
+				name: "statisticResearcher",
+				component: () => import('@/views/roadshow_manage/statistics/researcher.vue'),
+				meta:{
+					title:'研究员路演统计'
+				}
+			},
 			// {
 			// 	path: "statisticSeller",
 			// 	name: "销售路演统计",
@@ -59,8 +65,11 @@ export default [
 			},
 			// {
 			// 	path: "sellerCalendar",
-			// 	name: "销售员日历",
-			// 	component: () => import('@/views/roadshow_manage/sellerCalendar.vue')
+			// 	name: "sellerCalendar",
+			// 	component: () => import('@/views/roadshow_manage/sellerCalendar.vue'),
+			// 	meta:{
+			// 		title:'销售员日历'
+			// 	}
 			// },
 		]
 	},

+ 0 - 2
src/views/roadshow_manage/compononts/activityDetailDia.vue

@@ -1,8 +1,6 @@
 <script setup>
 import { ref,watch} from 'vue';
 import moment from 'moment';
-import { useRouter} from 'vue-router';
-import DatePicker from 'vue-datepicker-next';
 import { InfoFilled } from '@element-plus/icons-vue'
 
 import { roadshowInterence } from '@/api/api.js';

+ 56 - 0
src/views/roadshow_manage/meetingCalendar.vue

@@ -0,0 +1,56 @@
+<script setup>
+import { ref } from 'vue';
+import moment from 'moment';
+
+import { roadshowInterence } from "@/api/api.js";
+import calendar from "@/components/calendar.vue";
+
+// 活动列表
+const eventList=ref([])
+
+const calendarRef=ref(null)
+
+// 获取会议列表
+const getEventList=async()=>{
+  //当前的起始日期
+  const { currentStart,currentEnd } = calendarRef.value.calendarApi.view;
+
+  const { formateDate } = calendarRef.value;
+
+  // 获取本周日程
+  const { Data,Ret } = await roadshowInterence.meetCalendarDetail({
+    StartDate: formateDate(currentStart),
+    EndDate: formateDate(new Date(currentEnd.getTime()- 24*60*60*1000)),
+  });
+
+  if(Ret !== 200) return
+
+  //按开始时间重新排序
+  Data.Group ? Data.Group.forEach(item => {
+    item.CalendarList = item.CalendarList.sort((a,b) => moment(`${a.StartDate} ${a.StartTime}`).valueOf() -  moment(`${b.StartDate} ${b.StartTime}`).valueOf())
+  }) : []
+
+  eventList.value =  Data.Group?Data.Group.map((item, index) => {
+    return { ...item, id: index };
+  }):[];
+}
+
+</script>
+
+<template>
+  <div class="researcher-calendar">
+    <el-card class="researcher-calendar-context">
+      <!-- 日程组件 -->
+      <calendar
+        ref="calendarRef"
+        :eventList="eventList"
+        @weekChange="getEventList"
+        fromCode="meet"
+      >
+      </calendar>
+    </el-card>
+  </div>
+</template>
+
+<style>
+</style>

+ 172 - 0
src/views/roadshow_manage/statistics/researcher.vue

@@ -0,0 +1,172 @@
+<script setup>
+import _ from "lodash"
+import { nextTick } from 'vue';
+import DatePicker from 'vue-datepicker-next';
+import $ from 'jquery'
+
+import { roadshowInterence } from '@/api/api.js';
+import actiyityDetailDia from '../compononts/activityDetailDia.vue';
+import {roadshowStatisticsHook} from "./hooks"
+
+/* 获取表格数据 */
+const getTableData=()=>{
+	dataLoading.value = false;
+	roadshowInterence.researcherStatistic({
+		DataType: default_tab.value === '周度统计表' ? 'week' : default_tab.value === '月度统计表' ? 'month' : 'time_interval',
+		StartDate: select_date.value ? select_date.value[0] : '',
+		EndDate: select_date.value ? select_date.value[1] : '',
+	}).then(res => {
+		const { Data,Ret } = res;
+		if(Ret !== 200) return
+
+		//总合计数据处理
+		totalGroupArr.value = filterTableData(Data.RsReportRecordNumList);
+
+		//处理数据结构
+		let data = _.cloneDeep(Data.List);
+		data.forEach(item => {
+			
+			let groupDataArr = filterTableData(item.RsReportRecordNumList);
+			item.subGroupArr=groupDataArr
+
+			item.Item && item.Item.forEach(sub_item => {
+				
+				let dataArr = filterTableData(sub_item.RsReportRecordNumList,sub_item.AdminId)
+				sub_item.dataArr=dataArr
+			})
+		})
+
+		datalist.value = data;
+
+		const dynamic_width = {
+			'周度统计表': '9%',
+			'月度统计表': '7%',
+		}
+		nextTick(() => {
+			dataLoading.value = true;
+			$('table').find('td').css({ width: dynamic_width[default_tab.value]?dynamic_width[default_tab.value]:'25%'})
+			$('table').find('.thead-rs').css({ width: dynamic_width[default_tab.value] ? dynamic_width[default_tab.value] : '120px' })
+			$('table').find('.head-column').css({ width: dynamic_width[default_tab.value] ? dynamic_width[default_tab.value] : '25%' })
+		})
+	})
+}
+
+const HOOK = roadshowStatisticsHook({getTableData})
+const {dataLoading,default_tab,select_date,totalGroupArr,datalist,tableTheadColumns,staticTabs,
+	dialogForm,isShowDia,diaTitle}=HOOK.datas
+const {filterTableData,dateChange,openDiaHandle,changeTabHandle}=HOOK.functions
+
+getTableData()
+
+</script>
+
+<template>
+	<div class="statistic-container">
+		<div class="frequency-cont">
+			<ul class="frequency-ul">
+				<li v-for="tab in staticTabs" :key="tab" :class="{act: tab=== default_tab}" @click="changeTabHandle(tab)">{{ tab }}</li>
+			</ul>
+			<date-picker
+			v-model:value="select_date" 
+			type="date" 
+			range
+			value-type="format"
+			:clearable="false"
+			@change="dateChange"
+			placeholder="请选择统计时间"/>
+		</div>
+		<div class="table-cont" v-show="dataLoading">
+			<table>
+				<thead>
+					<tr>
+						<td rowspan="2" class="thead-rs">组别</td>
+						<td rowspan="2" class="thead-rs">研究员</td>
+						<td 
+							:colspan="['周度统计表','月度统计表'].includes(default_tab) ? 3 : 1" 
+							v-for="item in tableTheadColumns" 
+							:key="item" 
+							class="head-column"
+						>
+							{{item}}
+						</td>	
+					</tr>
+					<tr v-if="['月度统计表'].includes(default_tab)">
+						<template v-for="(item,index) in new Array(4)">
+							<td>试用路演</td>
+							<td>正式路演</td>
+							<td>公开会议</td>
+						</template>
+					</tr>
+					<tr v-if="['周度统计表'].includes(default_tab)">
+						<template v-for="(item,index) in new Array(3)">
+							<td>试用路演</td>
+							<td>正式路演</td>
+							<td>公开会议</td>
+						</template>
+					</tr>
+				</thead>
+			</table>
+
+			<div class="table-body-wrapper" ref="bodyRef">
+				<table>
+					<tbody v-for="item in datalist" :key="item.Name">
+							<tr>
+								<td :rowspan="item.Item.length+1" class="thead-rs">{{item.Name}}</td>
+							</tr>
+
+							<tr v-for="rs in item.Item" :key="rs.AdminId">
+								<td class="thead-rs">{{rs.Name}}</td>
+
+								<td
+									class="data-cell"
+									v-for="(data,data_key) in rs.dataArr" 
+									:key="data_key" 
+									@click="openDiaHandle(data)"
+								>
+									{{ data.value !== 0 ? data.value : '' }}
+								</td>
+
+							</tr>
+							
+							<tr>
+								<td colspan="2">组合计</td>
+								<td 
+									v-for="(group_data,group_data_key) in item.subGroupArr" 
+									:key="group_data_key"
+								>
+									{{ group_data.value !== 0 ? group_data.value : '' }}
+								</td>
+
+							</tr>
+					</tbody>
+
+						<tfoot>
+							<tr>
+								<td colspan="2">总合计</td>
+								<td 
+									v-for="(total_data,total_data_key) in totalGroupArr" 
+									:key="total_data_key"
+								>
+									{{  total_data.value !== 0 ? total_data.value : '' }}
+								</td>
+							</tr>
+						</tfoot>
+				</table>
+			</div>	
+		</div>
+
+		<!-- 详情弹窗 -->
+		<actiyityDetailDia
+			v-model:isShow="isShowDia"
+			:title="diaTitle"
+			:form="dialogForm"
+			fromType="researcher"
+		/>
+
+	</div>
+</template>
+
+<style lang='scss' scoped>
+*{ box-sizing: border-box;}
+@import './index.scss';
+</style>

Some files were not shown because too many files changed in this diff