|
@@ -0,0 +1,260 @@
|
|
|
+<template>
|
|
|
+ <div class="dailyStatisticBox">
|
|
|
+ <h4 class="title">我收到的日志</h4>
|
|
|
+ <div class="searchBox">
|
|
|
+ <el-form :inline="true" class="demo-form-inline">
|
|
|
+ <el-form-item label="日志类型:">
|
|
|
+ <el-select v-model="reportType">
|
|
|
+ <el-option label="周报" value="weekly" />
|
|
|
+ <el-option label="日报" value="daily" />
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" :icon="Search" @click="onSearchHandle">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="tableBox">
|
|
|
+ <div v-for="(item, index) in tableData" :key="index" class="log-box">
|
|
|
+ <div class="box-title">
|
|
|
+ <div class="user-name">
|
|
|
+ <el-avatar :size="40" :src="userInfo.avatar" />
|
|
|
+ <span class="name">{{ item.userNickname ?? '匿名' }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.reportType == 'daily'" class="log-time">{{
|
|
|
+ moment(item.reportStartDate).format('YYYY-MM-DD')
|
|
|
+ }}</div>
|
|
|
+ <div v-else class="log-times">{{
|
|
|
+ `${moment(item.reportStartDate).format('YYYY/MM/DD')} - ${moment(
|
|
|
+ item.reportEndDate
|
|
|
+ ).format('YYYY/MM/DD')}`
|
|
|
+ }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="box-content">
|
|
|
+ <p class="content-title">{{
|
|
|
+ item.reportType === 'daily' ? '今日完成工作' : '本周完成工作'
|
|
|
+ }}</p>
|
|
|
+ <p class="content" v-html="item.reportContent.replace(/(\r\n|\n|\r)/gm, '<br />')"></p>
|
|
|
+ <p class="content-title">工作量分配</p>
|
|
|
+ <div v-for="(work, num) in item.workload" :key="num" class="content">
|
|
|
+ {{ `(${work.workTime}小时)${work.projectName}` }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="box-foot">
|
|
|
+ <div class="create-time">{{ moment(item.createTime).format('YYYY-MM-DD HH:mm:ss') }}</div>
|
|
|
+ <div class="look-detail" @click="jumpLogDetail(item)">查看详情</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="pageBox">
|
|
|
+ <el-pagination
|
|
|
+ :style="{ float: 'right', marginTop: '15px' }"
|
|
|
+ v-model:current-page="pageNo"
|
|
|
+ v-model:page-size="pageSize"
|
|
|
+ :total="total"
|
|
|
+ layout="total, prev, pager, next, sizes, jumper"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import request from '@/config/axios'
|
|
|
+import { Search } from '@element-plus/icons-vue'
|
|
|
+import moment from 'moment'
|
|
|
+import { getUserInfo } from '@/utils/tool'
|
|
|
+
|
|
|
+defineOptions({ name: 'MyReceiveLog' })
|
|
|
+
|
|
|
+const { push } = useRouter()
|
|
|
+
|
|
|
+// 查看详情
|
|
|
+const jumpLogDetail = (item: any): void => {
|
|
|
+ const userId = item.userId ?? ''
|
|
|
+ const userName = item.userNickname ?? ''
|
|
|
+ if (item.reportType == 'daily') {
|
|
|
+ push({
|
|
|
+ name: 'DailyLogDetail',
|
|
|
+ query: {
|
|
|
+ userId: userId,
|
|
|
+ userName: userName,
|
|
|
+ date: `${item.reportYear}-${item.reportMonth}`,
|
|
|
+ reportStartDate: item.reportStartDate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ push({
|
|
|
+ name: 'WeeklyLogDetail',
|
|
|
+ query: {
|
|
|
+ userId: userId,
|
|
|
+ userName: userName,
|
|
|
+ date: `${item.reportYear}-${item.reportMonth}`,
|
|
|
+ reportStartDate: item.reportStartDate,
|
|
|
+ reportEndDate: item.reportEndDate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 查询
|
|
|
+const onSearchHandle = (): void => {
|
|
|
+ getDailyStatisticData()
|
|
|
+}
|
|
|
+const handleCurrentChange = (current): void => {
|
|
|
+ pageNo.value = current
|
|
|
+}
|
|
|
+const handleSizeChange = (size): void => {
|
|
|
+ pageSize.value = size
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // 获取收到的日志数据
|
|
|
+ getDailyStatisticData()
|
|
|
+})
|
|
|
+
|
|
|
+const userInfo = getUserInfo()
|
|
|
+const tableData = ref<any[]>([])
|
|
|
+const reportType = ref<'daily' | 'weekly' | ''>('')
|
|
|
+const pageSize = ref<number>(20)
|
|
|
+const pageNo = ref<number>(1)
|
|
|
+const total = ref<number>(0)
|
|
|
+// 获取日报统计数据
|
|
|
+const getDailyStatisticData = async (): Promise<void> => {
|
|
|
+ const params: any = {
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ pageNo: pageNo.value
|
|
|
+ }
|
|
|
+
|
|
|
+ if (reportType.value !== '') {
|
|
|
+ params.reportType = reportType.value
|
|
|
+ }
|
|
|
+ const { list = [], total: resTotal = 0 } = await request.get({
|
|
|
+ url: '/adm/report/page/me',
|
|
|
+ params
|
|
|
+ })
|
|
|
+ tableData.value = list
|
|
|
+ total.value = resTotal
|
|
|
+}
|
|
|
+watch([() => pageSize.value, () => pageNo.value], () => {
|
|
|
+ getDailyStatisticData()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.dailyStatisticBox {
|
|
|
+ margin-top: 20px;
|
|
|
+ height: calc(100% - 20px);
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20px;
|
|
|
+ padding: 20px;
|
|
|
+ font-family:
|
|
|
+ Microsoft YaHei,
|
|
|
+ Microsoft YaHei;
|
|
|
+ .title {
|
|
|
+ height: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 24px;
|
|
|
+ color: #121518;
|
|
|
+ line-height: 28px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+ .tableBox {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 150px);
|
|
|
+ overflow-y: scroll;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .log-box {
|
|
|
+ width: 400px;
|
|
|
+ height: 300px;
|
|
|
+ border-radius: 12px 12px 12px 12px;
|
|
|
+ border: 2px solid #2e77e6;
|
|
|
+ margin-right: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ ::-webkit-scrollbar {
|
|
|
+ width: 0 !important;
|
|
|
+ }
|
|
|
+ .box-title {
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ // line-height: 70px;
|
|
|
+ border-bottom: 1px solid #dee0e3;
|
|
|
+ padding: 0 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .user-name {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #2e77e6;
|
|
|
+ .name {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .log-time {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ .log-times {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ .el-avatar {
|
|
|
+ border: 3px solid #b5b9bf;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .box-content {
|
|
|
+ height: 140px;
|
|
|
+ padding: 20px;
|
|
|
+ border-bottom: 1px solid #dee0e3;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
+ .content-title {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #5f6d81;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #000000;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .box-foot {
|
|
|
+ width: 100%;
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ background: linear-gradient(180deg, rgba(242, 244, 248, 0) 0%, #e8efff 100%);
|
|
|
+ border-radius: 0 0 10px 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 20px;
|
|
|
+ .create-time {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #505a69;
|
|
|
+ }
|
|
|
+ .look-detail {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #2e77e6;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .pageBox {
|
|
|
+ padding-top: 10px;
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|