|
|
|
|
@ -120,7 +120,14 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="交流目的" align="center" prop="exchangePurpose" width="150" show-overflow-tooltip v-if="columns[17].visible" />
|
|
|
|
|
<el-table-column label="会议/展会名称" align="center" prop="meetingName" width="150" show-overflow-tooltip v-if="columns[19].visible" />
|
|
|
|
|
<el-table-column label="交流过程与反馈" align="center" prop="exchangeFeedback" width="200" show-overflow-tooltip v-if="columns[20].visible">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="交流过程与反馈"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="exchangeFeedback"
|
|
|
|
|
width="200"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
v-if="columns[20].visible && hasTripCommViewRole"
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span v-if="canViewRowFeedback(scope.row)">{{ scope.row.exchangeFeedback }}</span>
|
|
|
|
|
<span v-else style="color: #c0c4cc">-</span>
|
|
|
|
|
@ -146,19 +153,19 @@
|
|
|
|
|
<el-tooltip content="查看详情" placement="top" v-if="scope.row.flowStatus !== 'draft' && scope.row.flowStatus">
|
|
|
|
|
<el-button link type="info" icon="DocumentChecked" @click="handleView(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip
|
|
|
|
|
content="填写反馈"
|
|
|
|
|
placement="top"
|
|
|
|
|
v-if="scope.row.tripStatus === '3' && (scope.row.tripType === '2' || scope.row.tripType === '3') && canViewRowFeedback(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="success"
|
|
|
|
|
icon="ChatDotRound"
|
|
|
|
|
@click="handleFeedback(scope.row)"
|
|
|
|
|
v-hasPermi="['oa/crm:businessTripApply:edit']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- <el-tooltip-->
|
|
|
|
|
<!-- content="填写反馈"-->
|
|
|
|
|
<!-- placement="top"-->
|
|
|
|
|
<!-- v-if="scope.row.tripStatus === '3' && (scope.row.tripType === '2' || scope.row.tripType === '3') && canViewRowFeedback(scope.row)"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <el-button-->
|
|
|
|
|
<!-- link-->
|
|
|
|
|
<!-- type="success"-->
|
|
|
|
|
<!-- icon="ChatDotRound"-->
|
|
|
|
|
<!-- @click="handleFeedback(scope.row)"-->
|
|
|
|
|
<!-- v-hasPermi="['oa/crm:businessTripApply:edit']"-->
|
|
|
|
|
<!-- ></el-button>-->
|
|
|
|
|
<!-- </el-tooltip>-->
|
|
|
|
|
<!-- <el-tooltip content="删除" placement="top">-->
|
|
|
|
|
<!-- <el-button-->
|
|
|
|
|
<!-- link-->
|
|
|
|
|
@ -204,8 +211,21 @@ import { UserQuery, UserVO } from '@/api/system/user/types';
|
|
|
|
|
import { allListDept, listDept } from '@/api/system/dept';
|
|
|
|
|
import { DeptVO } from '@/api/system/dept/types';
|
|
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
import { getInfo } from '@/api/login';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
|
|
|
|
const userRoles = ref<string[]>([]);
|
|
|
|
|
// "市场交流反馈查看"角色
|
|
|
|
|
const hasTripCommViewRole = computed(() => userRoles.value?.some((role) => role === 'tripCommView'));
|
|
|
|
|
|
|
|
|
|
// 拥有角色 或 当前用户是该行数据的创建人
|
|
|
|
|
const canViewRowFeedback = (row: BusinessTripApplyVO): boolean => {
|
|
|
|
|
if (hasTripCommViewRole.value) return true;
|
|
|
|
|
const currentUserId = String(useUserStore().userId);
|
|
|
|
|
if (row.createBy && currentUserId === String(row.createBy)) return true;
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
const { trip_status, trip_type, business_direction } = toRefs<any>(proxy?.useDict('trip_status', 'trip_type', 'business_direction'));
|
|
|
|
|
|
|
|
|
|
const businessTripApplyList = ref<BusinessTripApplyVO[]>([]);
|
|
|
|
|
@ -219,32 +239,6 @@ const router = useRouter();
|
|
|
|
|
const userList = ref<UserVO[]>([]);
|
|
|
|
|
const deptList = ref<DeptVO[]>([]);
|
|
|
|
|
|
|
|
|
|
// 业务方向负责人ID映射
|
|
|
|
|
const BUSINESS_DIRECTION_LEADER_MAP: Record<number, string> = {
|
|
|
|
|
1: '1985254821554475009',
|
|
|
|
|
2: '1985258519835889666',
|
|
|
|
|
3: '1985251968270127105',
|
|
|
|
|
4: '1985257496048226305',
|
|
|
|
|
5: '1985254145713688578'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 逐行判断“交流过程与反馈”可见性:申请人、业务方向负责人、陈海军、张东辉
|
|
|
|
|
const canViewRowFeedback = (row: BusinessTripApplyVO): boolean => {
|
|
|
|
|
const currentUserId = String(useUserStore().userId);
|
|
|
|
|
// 1. 申请人本人
|
|
|
|
|
if (row.applicantId && currentUserId === String(row.applicantId)) return true;
|
|
|
|
|
// 2. 陈海军、张东辉
|
|
|
|
|
const fixedIds = ['陈海军', '张东辉']
|
|
|
|
|
.map(name => userList.value.find((u: any) => u.nickName === name))
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
.map((u: any) => String(u.userId));
|
|
|
|
|
if (fixedIds.includes(currentUserId)) return true;
|
|
|
|
|
// 3. 业务方向负责人
|
|
|
|
|
const bd = Number(row.businessDirection);
|
|
|
|
|
if (bd && BUSINESS_DIRECTION_LEADER_MAP[bd] && currentUserId === BUSINESS_DIRECTION_LEADER_MAP[bd]) return true;
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
|
|
|
// 列显隐信息
|
|
|
|
|
@ -380,6 +374,13 @@ const handleExport = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
// 获取当前用户角色
|
|
|
|
|
try {
|
|
|
|
|
const infoRes = await getInfo();
|
|
|
|
|
userRoles.value = infoRes.data?.roles || [];
|
|
|
|
|
} catch (e) {
|
|
|
|
|
userRoles.value = [];
|
|
|
|
|
}
|
|
|
|
|
// 加载用户列表
|
|
|
|
|
const userQuery = ref<UserQuery>();
|
|
|
|
|
const userRes = await getUserList(userQuery.value);
|
|
|
|
|
@ -391,10 +392,6 @@ onMounted(async () => {
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onActivated(() => {
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ============ 出差反馈相关 ============
|
|
|
|
|
const feedbackDialogVisible = ref(false);
|
|
|
|
|
const feedbackLoading = ref(false);
|
|
|
|
|
@ -414,21 +411,21 @@ const feedbackRules = {
|
|
|
|
|
exchangeFeedback: [{ required: true, message: '请填写交流过程与反馈', trigger: 'blur' }]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 填写反馈按钮操作 */
|
|
|
|
|
const handleFeedback = (row: BusinessTripApplyVO) => {
|
|
|
|
|
feedbackForm.value = {
|
|
|
|
|
tripId: row.tripId,
|
|
|
|
|
applyCode: row.applyCode,
|
|
|
|
|
tripType: row.tripType,
|
|
|
|
|
applicantId: row.applicantId,
|
|
|
|
|
tripLocation: row.tripLocation,
|
|
|
|
|
startTime: row.startTime,
|
|
|
|
|
endTime: row.endTime,
|
|
|
|
|
durationDays: row.durationDays,
|
|
|
|
|
exchangeFeedback: row.exchangeFeedback || ''
|
|
|
|
|
};
|
|
|
|
|
feedbackDialogVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
// /** 填写反馈按钮操作 */
|
|
|
|
|
// const handleFeedback = (row: BusinessTripApplyVO) => {
|
|
|
|
|
// feedbackForm.value = {
|
|
|
|
|
// tripId: row.tripId,
|
|
|
|
|
// applyCode: row.applyCode,
|
|
|
|
|
// tripType: row.tripType,
|
|
|
|
|
// applicantId: row.applicantId,
|
|
|
|
|
// tripLocation: row.tripLocation,
|
|
|
|
|
// startTime: row.startTime,
|
|
|
|
|
// endTime: row.endTime,
|
|
|
|
|
// durationDays: row.durationDays,
|
|
|
|
|
// exchangeFeedback: row.exchangeFeedback || ''
|
|
|
|
|
// };
|
|
|
|
|
// feedbackDialogVisible.value = true;
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
/** 提交反馈 */
|
|
|
|
|
const submitFeedback = async () => {
|
|
|
|
|
|