feat: 支局长/分管领导可为任意客户经理代填记录
后端: - 5个模块的 Create/Update schema 新增可选 manager_id 字段 - POST 端点: director/leader 可指定 manager_id,manager 角色自动用自身 - PUT 端点: director/leader 可修改 manager_id,manager 角色禁止修改 前端(移动端+桌面端共10个页面): - 支局长/领导可见「客户经理」下拉选择框 - 创建和编辑时均可指定记录归属的客户经理 - 涵盖今日拜访、今日纪要、工作计划、商机跟单、要客拜访五个模块 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ const themeStore = useThemeStore()
|
||||
const loading = ref(false)
|
||||
const workPlans = ref<any[]>([])
|
||||
const customers = ref<any[]>([])
|
||||
const allManagers = ref<any[]>([])
|
||||
const shotRef = ref<HTMLElement | null>(null)
|
||||
const { capturing, captureEl } = useScreenshot()
|
||||
|
||||
@@ -65,6 +66,9 @@ const managerSummary = computed(() => {
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([loadPlans(), loadCustomers(), loadManagerColors()])
|
||||
if (auth.isDirector || auth.isLeader) {
|
||||
api.get('/users/', { params: { role: 'manager' } }).then(r => { allManagers.value = r.data }).catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
const customerSearch = ref('')
|
||||
@@ -111,7 +115,7 @@ async function loadPlans() {
|
||||
|
||||
function openCreate() {
|
||||
dialogMode.value = 'create'
|
||||
form.value = { customer_id: '', plan_content: '', plan_date: todayStr(), status: '计划中' }
|
||||
form.value = { customer_id: '', plan_content: '', plan_date: todayStr(), status: '计划中', manager_id: auth.userId || '' }
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
@@ -270,6 +274,11 @@ async function quickStatusChange(row: any, newStatus: string) {
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="auth.isDirector || auth.isLeader" label="客户经理">
|
||||
<el-select v-model="form.manager_id" filterable placeholder="选择客户经理" style="width:100%">
|
||||
<el-option v-for="m in allManagers" :key="m.id" :label="m.name" :value="m.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划拜访时间">
|
||||
<el-date-picker v-model="form.plan_date" type="date" style="width:100%" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user