fix: 修复扣分数字点击事件,添加事件阻止冒泡和调试日志

This commit is contained in:
Your Name 2026-01-13 16:54:19 +08:00
parent 607270c158
commit fcc6a2a367
2 changed files with 14 additions and 2 deletions

View File

@ -91,6 +91,10 @@ export interface DesignerStat {
fiveStarCount: number;
satisfactionRate: number;
totalScore: number;
deductionScore?: number;
netScore?: number;
targetScore?: number;
targetCompletionRate?: number;
weekCompletedCount: number;
monthCompletedCount: number;
}

View File

@ -253,7 +253,7 @@
<template v-else-if="column.key === 'deductionScore'">
<span
class="deduction-value clickable"
@click="showDeductionDetails(record)"
@click.stop="showDeductionDetails(record)"
:style="{ cursor: (record.deductionScore && record.deductionScore > 0) ? 'pointer' : 'default' }"
>
{{ record.deductionScore || 0 }}
@ -1088,17 +1088,25 @@ const handleDeptChange = (deptId: number | undefined) => {
// 显示扣分明细
const showDeductionDetails = async (record: any) => {
if (!record.deductionScore || record.deductionScore <= 0) {
console.log('点击扣分数字:', record)
const deduction = record.deductionScore || 0
console.log('扣分值:', deduction)
if (!deduction || deduction <= 0) {
console.log('扣分为0,不显示弹窗')
return // 没有扣分,不显示弹窗
}
console.log('打开扣分明细弹窗,userId:', record.userId)
currentDesigner.value = record
deductionDetailVisible.value = true
deductionDetailLoading.value = true
try {
const month = selectedMonth.value || undefined
console.log('请求扣分明细,userId:', record.userId, 'month:', month)
const detail = await getDesignerDeductionDetails(record.userId, month)
console.log('扣分明细数据:', detail)
deductionDetail.value = detail
} catch (error) {
message.error('加载扣分明细失败')