企迹(qiji) 政企周报管理系统 — v0.1

后端: FastAPI + SQLAlchemy 2.0 (async) + Alembic + MinIO + Casdoor + 企微
前端: Vue 3 + Vite + TypeScript + Element Plus + Pinia

功能清单:
- 8 张数据表自动建表 / Casdoor OIDC 登录 / 企微静默登录
- 双布局: 移动端(填报) + PC端(汇总管理)
- 拜访记录 CRUD + MinIO 照片直传 + 缩略图预览 + 同访人草稿
- 今日纪要 (6 分类) / 工作计划 / 小微商机 / 要客拜访 CRUD
- 客户档案: 备注/收支费用/联系人/归属分配/批量转移
- 客户导入导出 + 模板下载 + 搜索/分页/筛选
- 仪表盘: 四卡统计 + 填报进度 (拜访+纪要双维度)
- 周报详情: 五 Tab + 按人/客户筛选 + 时间轴
- 用户管理 / 客户经理 PC 端工作台
- 企微: 催办/公告/定时提醒 / 时区修正
- Docker 部署配置

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-23 01:35:46 +08:00
parent 2a8225c31f
commit a1886074dd
97 changed files with 8830 additions and 0 deletions
+136
View File
@@ -0,0 +1,136 @@
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { useRouter } from 'vue-router'
import { visitsApi } from '@/api/visits'
import { uploadApi } from '@/api/upload'
import { ElMessage } from 'element-plus'
import api from '@/api/index'
const router = useRouter()
const todayVisitCount = ref(0)
const visits = ref<any[]>([])
const todayNoteCount = ref(0)
const dailyNotes = ref<any[]>([])
const photoUrls = ref<Record<string, string>>({})
const loading = ref(false)
const todayTotal = computed(() => todayVisitCount.value + todayNoteCount.value)
const categoryColors: Record<string, string> = {
'行政事务': '#409EFF', '合同整理': '#67C23A', '发票处理': '#E6A23C',
'内部会议': '#F56C6C', '培训学习': '#909399', '其他': '#B37FEB',
}
async function loadToday() {
loading.value = true
try {
const [vRes, nRes] = await Promise.all([
visitsApi.getToday(),
api.get('/daily-notes/today'),
])
todayVisitCount.value = vRes.data.count
visits.value = vRes.data.visits
todayNoteCount.value = nRes.data.count
dailyNotes.value = nRes.data.notes
for (const v of visits.value) {
if (v.photos?.length > 0) {
for (const key of v.photos) {
try {
const urlRes = await uploadApi.getDownloadUrl(key)
photoUrls.value[key] = urlRes.data.download_url
} catch (_) {}
}
}
}
} catch (e: any) {
ElMessage.error('加载失败')
} finally { loading.value = false }
}
onMounted(loadToday)
</script>
<template>
<div class="mobile-home">
<!-- Today Summary -->
<div class="today-badge">
<el-icon :size="48"><Notebook /></el-icon>
<div class="badge-text">
<div class="badge-count">{{ todayTotal }}</div>
<div class="badge-label">今日已录入拜访{{ todayVisitCount }} + 纪要{{ todayNoteCount }}</div>
</div>
</div>
<div class="quick-actions">
<el-button type="primary" size="large" @click="router.push('/m/visit/new')" style="flex:1">+ 今日拜访</el-button>
<el-button type="success" size="large" @click="router.push('/m/note/new')" style="flex:1">📝 今日纪要</el-button>
</div>
<div class="quick-links">
<el-button @click="router.push('/m/work-plan/new')">📋 工作计划</el-button>
<el-button @click="router.push('/m/mini-biz/new')">💼 商机跟单</el-button>
<el-button @click="router.push('/m/key-visit/new')"> 要客拜访</el-button>
</div>
<div v-loading="loading">
<!-- Daily Notes -->
<template v-if="dailyNotes.length">
<h4>📝 今日纪要</h4>
<el-card v-for="n in dailyNotes" :key="n.id" class="note-card" shadow="hover">
<div class="card-header">
<el-tag :color="categoryColors[n.category]" effect="dark" size="small">{{ n.category }}</el-tag>
<span v-if="n.time_range" class="time">{{ n.time_range }}</span>
</div>
<div class="card-body">{{ n.content }}</div>
<div class="card-footer">
<el-button text size="small" @click="router.push(`/m/note/${n.id}/edit`)">编辑</el-button>
</div>
</el-card>
</template>
<!-- Visits -->
<h4 v-if="visits.length">🏢 今日拜访记录</h4>
<div v-if="visits.length === 0 && dailyNotes.length === 0" class="empty">今日暂无记录点击上方按钮开始填报</div>
<el-card v-for="v in visits" :key="v.id" class="visit-card" shadow="hover">
<div class="card-header">
<span class="customer-name">{{ v.customer_name || '-' }}</span>
<el-tag size="small">{{ v.visit_method }}</el-tag>
</div>
<div class="card-body">
<div>{{ v.communication_content || '暂无沟通内容' }}</div>
<div v-if="v.customer_demand" class="demand">📌 需求: {{ v.customer_demand }}</div>
</div>
<div class="card-photos" v-if="v.photos?.length">
<img v-for="key in v.photos" :key="key" :src="photoUrls[key] || ''" class="photo-thumb" />
</div>
<div class="card-footer">
<span class="time">{{ v.time_range }}</span>
<el-button text size="small" @click="router.push(`/m/visit/${v.id}/edit`)">编辑</el-button>
</div>
</el-card>
</div>
</div>
</template>
<style scoped>
.mobile-home { padding-bottom: 20px; }
.today-badge {
display: flex; align-items: center; gap: 16px;
background: linear-gradient(135deg, #e8f0fe, #f0f5ff); border-radius: 16px; padding: 20px; margin-bottom: 16px;
}
.badge-count { font-size: 36px; font-weight: 700; color: #1a73e8; }
.badge-label { font-size: 13px; color: #606266; }
.quick-actions { display: flex; gap: 12px; margin-bottom: 12px; }
.quick-links { display: flex; gap: 8px; margin-bottom: 20px; }
h4 { margin: 16px 0 12px; color: #303133; }
.empty { text-align: center; color: #c0c4cc; padding: 40px 0; }
.visit-card, .note-card { margin-bottom: 12px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.customer-name { font-weight: 600; font-size: 15px; }
.demand { color: #e6a23c; margin-top: 4px; font-size: 13px; }
.card-photos { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: #909399; }
.card-body { font-size: 14px; color: #303133; }
.time { font-size: 12px; color: #909399; }
</style>