|
|
@@ -321,15 +321,20 @@
|
|
|
}
|
|
|
};
|
|
|
const viewDetailData = ref<Record<string, unknown>>({});
|
|
|
+ const authority = ref(false)
|
|
|
const currentId = computed(() => Number(route.query.planId));
|
|
|
const getDetail = async () => {
|
|
|
if (!currentId.value) return;
|
|
|
try {
|
|
|
const res = await queryAreaCheckPlanManageDeptDetail(currentId.value);
|
|
|
- const raw = (res as { data?: unknown })?.data ?? res;
|
|
|
- const detail = mapAreaCheckPlanApiRecordToUi(raw);
|
|
|
- viewDetailData.value = { ...detail };
|
|
|
- // loadRecordList();
|
|
|
+ viewDetailData.value = { ...res };
|
|
|
+ // 如果主责部门责任人ID包含当前登录人ID,则直接回填(被检查单位、 检查人员、检查时间、检查地点),且不可更改
|
|
|
+ let primaryResponsibleDeptPersonCode = res.primaryResponsibleDeptPersonCode?.split(',').map(Number)
|
|
|
+ if(primaryResponsibleDeptPersonCode?.includes(id)){
|
|
|
+ authority.value = true
|
|
|
+ formData.value.inspectedUnit = res.primaryResponsibleDeptName || ''
|
|
|
+ formData.value.inspector = String(res.primaryResponsibleDeptPersonName) || ''
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
console.error('获取详情失败:', e);
|
|
|
}
|