|
|
@ -45,15 +45,22 @@ |
|
|
<!---------- 表格操作行 begin -----------> |
|
|
<!---------- 表格操作行 begin -----------> |
|
|
<a-row class="smart-table-btn-block"> |
|
|
<a-row class="smart-table-btn-block"> |
|
|
<div class="smart-table-operate-block"> |
|
|
<div class="smart-table-operate-block"> |
|
|
<!-- 申请律师无处罚证明:只有user角色可以申请,行政人员不能申请 --> |
|
|
<!-- 律师申请无处罚证明 --> |
|
|
<a-button @click="() => showForm('user')" type="primary" v-if="isUser"> |
|
|
<a-button @click="() => showForm('user')" type="primary" v-if="isUser"> |
|
|
<template #icon> |
|
|
<template #icon> |
|
|
<PlusOutlined /> |
|
|
<PlusOutlined /> |
|
|
</template> |
|
|
</template> |
|
|
申请律师无处罚证明 |
|
|
申请无处罚证明 |
|
|
</a-button> |
|
|
</a-button> |
|
|
<!-- 申请律所无处罚证明:cto和staff都可以申请 --> |
|
|
<!-- 律所主任申请个人无处罚证明 --> |
|
|
<a-button @click="() => showForm('cto')" type="primary" v-if="isCto || isFirmAdmin"> |
|
|
<a-button @click="() => showForm('personal')" type="primary" v-if="isCto || isFirmAdmin"> |
|
|
|
|
|
<template #icon> |
|
|
|
|
|
<PlusOutlined /> |
|
|
|
|
|
</template> |
|
|
|
|
|
申请个人无处罚证明 |
|
|
|
|
|
</a-button> |
|
|
|
|
|
<!-- 律所主任申请律所无处罚证明 --> |
|
|
|
|
|
<a-button @click="() => showForm('firm')" type="primary" v-if="isCto || isFirmAdmin"> |
|
|
<template #icon> |
|
|
<template #icon> |
|
|
<PlusOutlined /> |
|
|
<PlusOutlined /> |
|
|
</template> |
|
|
</template> |
|
|
@ -117,21 +124,22 @@ |
|
|
<PenaltyApplyForm ref="formRef" @reloadList="queryData"/> |
|
|
<PenaltyApplyForm ref="formRef" @reloadList="queryData"/> |
|
|
|
|
|
|
|
|
<!-- 图片预览弹框 --> |
|
|
<!-- 图片预览弹框 --> |
|
|
<a-modal |
|
|
<a-modal |
|
|
:footer="null" |
|
|
:footer="null" |
|
|
:open="previewVisible" |
|
|
:open="previewVisible" |
|
|
@cancel="handleCancelPreview" |
|
|
@cancel="handleCancelPreview" |
|
|
:width="null" |
|
|
:width="null" |
|
|
class="image-preview-modal" |
|
|
class="image-preview-modal" |
|
|
:centered="true" |
|
|
:centered="true" |
|
|
:closable="true" |
|
|
:closable="true" |
|
|
:maskClosable="true" |
|
|
:maskClosable="true" |
|
|
|
|
|
:title="previewTitle" |
|
|
> |
|
|
> |
|
|
<div class="preview-container"> |
|
|
<div class="preview-container"> |
|
|
<div class="preview-content"> |
|
|
<div class="preview-content"> |
|
|
<img |
|
|
<img |
|
|
:src="previewUrl" |
|
|
:src="previewUrl" |
|
|
alt="无处罚证明" |
|
|
:alt="previewTitle" |
|
|
class="preview-image" |
|
|
class="preview-image" |
|
|
@error="handleImageError" |
|
|
@error="handleImageError" |
|
|
/> |
|
|
/> |
|
|
@ -257,18 +265,34 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
dataIndex: 'userName', |
|
|
dataIndex: 'userName', |
|
|
ellipsis: true, |
|
|
ellipsis: true, |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: '申请类型', |
|
|
|
|
|
dataIndex: 'applyType', |
|
|
|
|
|
ellipsis: true, |
|
|
|
|
|
width: 120, |
|
|
|
|
|
customRender: ({ text, record }) => { |
|
|
|
|
|
// 根据 applyType 字段值显示对应的申请类型 |
|
|
|
|
|
if (text === 'PERSONAL') { |
|
|
|
|
|
return '个人证明'; |
|
|
|
|
|
} else if (text === 'FIRM') { |
|
|
|
|
|
return '律所证明'; |
|
|
|
|
|
} else { |
|
|
|
|
|
return record.applyTypeName || text || '未知类型'; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '无处罚证明类型', |
|
|
title: '无处罚证明类型', |
|
|
dataIndex: 'type', |
|
|
dataIndex: 'type', |
|
|
ellipsis: true, |
|
|
ellipsis: true, |
|
|
customRender: ({ text, record }) => { |
|
|
customRender: ({ text, record }) => { |
|
|
// 根据type字段值显示对应的证明类型 |
|
|
// 根据 applyType 字段值显示对应的证明类型 |
|
|
if (text === 'cto') { |
|
|
if (record.applyType === 'PERSONAL') { |
|
|
|
|
|
return '个人无处罚证明'; |
|
|
|
|
|
} else if (record.applyType === 'FIRM') { |
|
|
return '律所无处罚证明'; |
|
|
return '律所无处罚证明'; |
|
|
} else if (text === 'user') { |
|
|
|
|
|
return '律师无处罚证明'; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
return text || '未知类型'; |
|
|
return '未知类型'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
@ -409,23 +433,30 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
// 检查用户角色 |
|
|
// 检查用户角色 |
|
|
function checkUserRole() { |
|
|
function checkUserRole() { |
|
|
if (loginInfo.value) { |
|
|
if (loginInfo.value) { |
|
|
// 根据用户角色判断权限 |
|
|
// 优先使用 roleCodeList 数组判断角色,如果没有则使用 roleCode 字符串 |
|
|
const userRole = loginInfo.value.roleCode || loginInfo.value.roleName || ''; |
|
|
let roleCodes = []; |
|
|
const roleLower = userRole.toLowerCase(); |
|
|
|
|
|
|
|
|
|
|
|
// CEO角色判断 |
|
|
|
|
|
isCeo.value = roleLower === 'ceo'; |
|
|
|
|
|
|
|
|
|
|
|
// User角色判断 |
|
|
|
|
|
isUser.value = roleLower === 'user'; |
|
|
|
|
|
|
|
|
|
|
|
// CTO角色判断(主任) |
|
|
|
|
|
isCto.value = roleLower === 'cto'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (loginInfo.value.roleCodeList && loginInfo.value.roleCodeList.length > 0) { |
|
|
|
|
|
// 使用 roleCodeList 数组 |
|
|
|
|
|
roleCodes = loginInfo.value.roleCodeList.map(r => r.toLowerCase()); |
|
|
|
|
|
} else if (loginInfo.value.roleCode) { |
|
|
|
|
|
// 使用 roleCode 字符串 |
|
|
|
|
|
roleCodes = [loginInfo.value.roleCode.toLowerCase()]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CEO 角色判断 |
|
|
|
|
|
isCeo.value = roleCodes.includes('ceo'); |
|
|
|
|
|
|
|
|
|
|
|
// User 角色判断 |
|
|
|
|
|
isUser.value = roleCodes.includes('user'); |
|
|
|
|
|
|
|
|
|
|
|
// CTO 角色判断(主任) |
|
|
|
|
|
isCto.value = roleCodes.includes('cto'); |
|
|
|
|
|
|
|
|
// 行政人员角色判断 |
|
|
// 行政人员角色判断 |
|
|
isFirmAdmin.value = roleLower === 'staff'; |
|
|
isFirmAdmin.value = roleCodes.includes('staff'); |
|
|
|
|
|
|
|
|
console.log('用户角色:', userRole, 'isCeo:', isCeo.value, 'isUser:', isUser.value, 'isCto:', isCto.value, 'isFirmAdmin:', isFirmAdmin.value); |
|
|
console.log('用户角色代码:', roleCodes, 'isCeo:', isCeo.value, 'isUser:', isUser.value, 'isCto:', isCto.value, 'isFirmAdmin:', isFirmAdmin.value); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -433,9 +464,9 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
const formRef = ref(); |
|
|
const formRef = ref(); |
|
|
|
|
|
|
|
|
function showForm(type, data) { |
|
|
function showForm(type, data) { |
|
|
// 将type参数传递给表单组件 |
|
|
// 将 type 参数作为第二个参数传递给表单组件的 show 方法 |
|
|
const formData = data ? { ...data, type } : { type }; |
|
|
// type: 'personal' - 申请个人证明,'firm' - 申请律所证明,'user' - 律师申请 |
|
|
formRef.value.show(formData); |
|
|
formRef.value.show(data, type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ---------------------------- 单个删除 ---------------------------- |
|
|
// ---------------------------- 单个删除 ---------------------------- |
|
|
@ -588,9 +619,9 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
const fileUrl = URL.createObjectURL(blob); |
|
|
const fileUrl = URL.createObjectURL(blob); |
|
|
|
|
|
|
|
|
console.log('创建的预览URL:', fileUrl); |
|
|
console.log('创建的预览URL:', fileUrl); |
|
|
|
|
|
|
|
|
message.destroy(); |
|
|
message.destroy(); |
|
|
showImagePreview(fileUrl); |
|
|
showImagePreview(fileUrl, record); |
|
|
} else { |
|
|
} else { |
|
|
message.destroy(); |
|
|
message.destroy(); |
|
|
// 尝试读取错误响应 |
|
|
// 尝试读取错误响应 |
|
|
@ -629,10 +660,25 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
const previewVisible = ref(false); |
|
|
const previewVisible = ref(false); |
|
|
const previewUrl = ref(''); |
|
|
const previewUrl = ref(''); |
|
|
const previewLoading = ref(false); |
|
|
const previewLoading = ref(false); |
|
|
|
|
|
const previewTitle = ref('无处罚证明预览'); |
|
|
|
|
|
const currentPreviewRecord = ref(null); |
|
|
|
|
|
|
|
|
// 显示图片预览 |
|
|
// 显示图片预览 |
|
|
function showImagePreview(url) { |
|
|
function showImagePreview(url, record) { |
|
|
previewUrl.value = url; |
|
|
previewUrl.value = url; |
|
|
|
|
|
currentPreviewRecord.value = record; |
|
|
|
|
|
// 根据申请类型设置预览标题 |
|
|
|
|
|
if (record) { |
|
|
|
|
|
if (record.applyType === 'PERSONAL' || record.type === 'USER') { |
|
|
|
|
|
previewTitle.value = '个人无处罚证明预览'; |
|
|
|
|
|
} else if (record.applyType === 'FIRM' || record.type === 'CTO') { |
|
|
|
|
|
previewTitle.value = '律所无处罚证明预览'; |
|
|
|
|
|
} else { |
|
|
|
|
|
previewTitle.value = '无处罚证明预览'; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
previewTitle.value = '无处罚证明预览'; |
|
|
|
|
|
} |
|
|
previewVisible.value = true; |
|
|
previewVisible.value = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -640,6 +686,8 @@ import PenaltyApplyForm from './penalty-apply-form.vue'; |
|
|
function handleCancelPreview() { |
|
|
function handleCancelPreview() { |
|
|
previewVisible.value = false; |
|
|
previewVisible.value = false; |
|
|
previewUrl.value = ''; |
|
|
previewUrl.value = ''; |
|
|
|
|
|
previewTitle.value = '无处罚证明预览'; |
|
|
|
|
|
currentPreviewRecord.value = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 图片加载错误处理 |
|
|
// 图片加载错误处理 |
|
|
|