Browse Source

fix:服务修改

master
wang 3 days ago
parent
commit
6b95cd7e19
  1. 4
      src/views/business/erp/cost/firm-reports-list.vue
  2. 74
      src/views/business/erp/penalty-apply/penalty-apply-form.vue
  3. 100
      src/views/business/erp/penalty-apply/penalty-apply-list.vue
  4. 91
      src/views/business/erp/service/firm-statistics-detail.vue
  5. 3
      src/views/business/erp/service/law-firm-service-report-statistics.vue
  6. 8
      src/views/business/erp/service/law-firm-statistics.vue
  7. 8
      src/views/business/erp/service/lawyer-service-report-statistics.vue
  8. 9
      src/views/business/erp/service/lawyer-statistics-detail.vue

4
src/views/business/erp/cost/firm-reports-list.vue

@ -57,12 +57,12 @@
<!---------- 表格操作行 begin ----------->
<a-row class="smart-table-btn-block">
<div class="smart-table-operate-block">
<a-button v-if="isCto" @click="showForm" type="primary" >
<!---------- <a-button v-if="isCeo" @click="showForm" type="primary" >
<template #icon>
<PlusOutlined />
</template>
新建
</a-button>
</a-button>----------->
<a-button v-if="isCto" @click="confirmBatchDelete" type="primary" danger :disabled="selectedRowKeyList.length == 0">
<template #icon>
<DeleteOutlined />

74
src/views/business/erp/penalty-apply/penalty-apply-form.vue

@ -15,6 +15,13 @@
:destroyOnClose="true"
>
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 6 }" >
<!-- 只有律所主任显示申请类型选择个人/律所行政人员只申请律所证明 -->
<a-form-item v-if="showApplyTypeSelect" label="申请类型" name="applyType">
<a-radio-group v-model:value="form.applyType" @change="onApplyTypeChange">
<a-radio value="PERSONAL">个人证明</a-radio>
<a-radio value="FIRM">律所证明</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="申请事由" name="usePurpose">
<a-textarea v-model:value="form.usePurpose" placeholder="请输入申请事由" :rows="4" />
</a-form-item>
@ -53,10 +60,31 @@
const currentUser = computed(() => ({
userId: userStore.userId,
userName: userStore.actualName,
departmentName: userStore.departmentName
departmentName: userStore.departmentName,
roleCodeList: userStore.roleCodeList || []
}));
function show(rowData) {
// CTO
const isFirmDirector = computed(() => {
return currentUser.value.roleCodeList.includes('CTO');
});
// STAFF
const isStaff = computed(() => {
return currentUser.value.roleCodeList.includes('STAFF');
});
// USER
const isLawyer = computed(() => {
return currentUser.value.roleCodeList.includes('USER');
});
//
const showApplyTypeSelect = computed(() => {
return isFirmDirector.value;
});
function show(rowData, applyType) {
Object.assign(form, formDefault);
//
@ -65,6 +93,33 @@
form.userId = currentUser.value.userId;
form.userName = currentUser.value.userName;
form.status = 0; //
// applyType
if (applyType === 'personal') {
//
form.applyType = 'PERSONAL';
form.type = 'cto'; //
} else if (applyType === 'firm') {
//
form.applyType = 'FIRM';
form.type = 'cto'; //
} else if (applyType === 'user') {
//
form.applyType = 'PERSONAL';
form.type = 'user';
} else if (isLawyer.value) {
//
form.applyType = 'PERSONAL';
form.type = 'user';
} else if (isFirmDirector.value) {
// /
form.applyType = 'FIRM';
form.type = 'cto';
} else if (isStaff.value) {
//
form.applyType = 'FIRM';
form.type = 'cto';
}
} else {
//
Object.assign(form, rowData);
@ -76,6 +131,18 @@
});
}
// type
function onApplyTypeChange(e) {
const applyType = e.target.value;
if (applyType === 'PERSONAL') {
//
form.type = isLawyer.value ? 'USER' : 'CTO';
} else {
//
form.type = 'CTO';
}
}
function onClose() {
Object.assign(form, formDefault);
visibleFlag.value = false;
@ -97,12 +164,15 @@
approvalRemark: undefined, //
createTime: undefined, //
updateTime: undefined, //
type: undefined, //
applyType: undefined, // PERSONAL-FIRM-
};
let form = reactive({ ...formDefault });
const rules = {
usePurpose: [{ required: true, message: '申请事由 必填' }],
applyType: [{ required: true, message: '申请类型 必填' }],
};
// ------------------------ ------------------------

100
src/views/business/erp/penalty-apply/penalty-apply-list.vue

@ -45,15 +45,22 @@
<!---------- 表格操作行 begin ----------->
<a-row class="smart-table-btn-block">
<div class="smart-table-operate-block">
<!-- 申请律师无处罚证明只有user角色可以申请行政人员不能申请 -->
<!-- 律师申请无处罚证明 -->
<a-button @click="() => showForm('user')" type="primary" v-if="isUser">
<template #icon>
<PlusOutlined />
</template>
申请律师无处罚证明
申请无处罚证明
</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>
<PlusOutlined />
</template>
@ -126,12 +133,13 @@
:centered="true"
:closable="true"
:maskClosable="true"
:title="previewTitle"
>
<div class="preview-container">
<div class="preview-content">
<img
:src="previewUrl"
alt="无处罚证明"
:alt="previewTitle"
class="preview-image"
@error="handleImageError"
/>
@ -257,18 +265,34 @@ import PenaltyApplyForm from './penalty-apply-form.vue';
dataIndex: 'userName',
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: '无处罚证明类型',
dataIndex: 'type',
ellipsis: true,
customRender: ({ text, record }) => {
// type
if (text === 'cto') {
// applyType
if (record.applyType === 'PERSONAL') {
return '个人无处罚证明';
} else if (record.applyType === 'FIRM') {
return '律所无处罚证明';
} else if (text === 'user') {
return '律师无处罚证明';
} else {
return text || '未知类型';
return '未知类型';
}
},
},
@ -409,23 +433,30 @@ import PenaltyApplyForm from './penalty-apply-form.vue';
//
function checkUserRole() {
if (loginInfo.value) {
//
const userRole = loginInfo.value.roleCode || loginInfo.value.roleName || '';
const roleLower = userRole.toLowerCase();
// 使 roleCodeList 使 roleCode
let roleCodes = [];
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 = roleLower === 'ceo';
// CEO
isCeo.value = roleCodes.includes('ceo');
// User
isUser.value = roleLower === 'user';
// User
isUser.value = roleCodes.includes('user');
// CTO
isCto.value = roleLower === 'cto';
// 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();
function showForm(type, data) {
// type
const formData = data ? { ...data, type } : { type };
formRef.value.show(formData);
// type show
// type: 'personal' - 'firm' - 'user' -
formRef.value.show(data, type);
}
// ---------------------------- ----------------------------
@ -590,7 +621,7 @@ import PenaltyApplyForm from './penalty-apply-form.vue';
console.log('创建的预览URL:', fileUrl);
message.destroy();
showImagePreview(fileUrl);
showImagePreview(fileUrl, record);
} else {
message.destroy();
//
@ -629,10 +660,25 @@ import PenaltyApplyForm from './penalty-apply-form.vue';
const previewVisible = ref(false);
const previewUrl = ref('');
const previewLoading = ref(false);
const previewTitle = ref('无处罚证明预览');
const currentPreviewRecord = ref(null);
//
function showImagePreview(url) {
function showImagePreview(url, record) {
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;
}
@ -640,6 +686,8 @@ import PenaltyApplyForm from './penalty-apply-form.vue';
function handleCancelPreview() {
previewVisible.value = false;
previewUrl.value = '';
previewTitle.value = '无处罚证明预览';
currentPreviewRecord.value = null;
}
//

91
src/views/business/erp/service/firm-statistics-detail.vue

@ -120,6 +120,20 @@
<div class="report-cell">{{ formatCurrency(summaryData.totalAnnualCost) }}</div>
</div>
</div>
<!-- 分页组件 -->
<div class="pagination-container">
<a-pagination
v-model:current="pagination.pageNum"
v-model:pageSize="pagination.pageSize"
:total="pagination.total"
:page-size-options="['10', '20', '50', '100']"
show-size-changer
show-total
@change="handlePageChange"
@showSizeChange="handlePageSizeChange"
/>
</div>
</div>
</div>
</template>
@ -166,6 +180,13 @@ const exportLoading = ref(false);
const tableData = ref([]);
const loading = ref(false);
//
const pagination = reactive({
pageNum: 1,
pageSize: 10,
total: 0
});
//
const queryForm = reactive({
year: new Date().getFullYear(),
@ -183,9 +204,18 @@ const quarterOptions = ref([
{ value: 4, label: '第四季度' }
]);
// CEO
// CEO
const isCeo = ref(false);
//
function getCurrentQuarter() {
const month = new Date().getMonth() + 1;
if (month <= 3) return 1;
if (month <= 6) return 2;
if (month <= 9) return 3;
return 4;
}
//
function initYearOptions() {
const currentYear = new Date().getFullYear();
@ -203,11 +233,19 @@ async function handleQuery() {
const params = {
year: queryForm.year,
quarter: queryForm.quarter,
firmId: queryForm.firmId || props.params?.firmId
firmId: queryForm.firmId || props.params?.firmId,
pageNum: pagination.pageNum,
pageSize: pagination.pageSize
};
const response = await serviceApplicationsApi.statisticsDepartment(params);
tableData.value = response.data || [];
if (response.data) {
tableData.value = response.data.list || [];
pagination.total = response.data.total || 0;
} else {
tableData.value = [];
pagination.total = 0;
}
} catch (error) {
message.error('查询失败');
@ -217,10 +255,26 @@ async function handleQuery() {
}
}
//
function handlePageChange(page, pageSize) {
pagination.pageNum = page;
pagination.pageSize = pageSize;
handleQuery();
}
//
function handlePageSizeChange(current, size) {
pagination.pageNum = 1;
pagination.pageSize = size;
handleQuery();
}
//
function handleReset() {
queryForm.quarter = null;
queryForm.firmId = null;
pagination.pageNum = 1;
pagination.pageSize = 10;
//
handleQuery();
}
@ -274,19 +328,25 @@ async function fetchStatisticsData() {
const params = {
year: props.params.year,
quarter: props.params.quarter,
firmId: props.params.firmId
firmId: props.params.firmId,
pageNum: pagination.pageNum,
pageSize: pagination.pageSize
};
// API
const response = await serviceApplicationsApi.statisticsDepartment(params);
tableData.value = response.data || [];
if (response.data) {
tableData.value = response.data.list || [];
pagination.total = response.data.total || 0;
} else {
tableData.value = [];
pagination.total = 0;
}
console.log('API返回的数据:', tableData.value);
//
tableData.value.forEach((item, index) => {
});
} catch (error) {
message.error('获取统计数据失败');
tableData.value = [];
pagination.total = 0;
} finally {
loading.value = false;
}
@ -302,10 +362,11 @@ async function handleExport() {
exportLoading.value = true;
try {
console.log('开始导出律所统计详情...');
// 使 queryForm props.params null
const exportParams = {
quarter: props.params.quarter,
year: props.params.year,
firmId: props.params.firmId
quarter: queryForm.quarter,
year: queryForm.year,
firmId: queryForm.firmId
//
};
@ -518,4 +579,12 @@ onMounted(() => {
font-weight: 600;
border-bottom: 1px solid #ddd;
}
/* 分页容器样式 */
.pagination-container {
padding: 16px;
text-align: right;
background: #fff;
border-top: 1px solid #ddd;
}
</style>

3
src/views/business/erp/service/law-firm-service-report-statistics.vue

@ -170,7 +170,7 @@
const queryFormState = {
firmId: undefined,
year: new Date().getFullYear(),
quarter: Math.ceil((new Date().getMonth() + 1) / 3),
quarter: null,
pageNum: 1,
pageSize: 10
};
@ -262,6 +262,7 @@
function onSearch() {
pagination.current = 1;
queryForm.pageNum = 1;
queryData();
}

8
src/views/business/erp/service/law-firm-statistics.vue

@ -32,7 +32,7 @@
/>
</a-form-item>
<a-form-item>
<a-button type="primary" @click="handleQuery" :loading="loading">
<a-button type="primary" @click="onSearch" :loading="loading">
<SearchOutlined />
查询
</a-button>
@ -178,6 +178,12 @@ function initYearOptions() {
yearOptions.value = years;
}
//
function onSearch() {
pagination.value.current = 1;
handleQuery();
}
//
async function handleQuery() {
try {

8
src/views/business/erp/service/lawyer-service-report-statistics.vue

@ -135,9 +135,10 @@
{ label: '第四季度', value: 4 }
]);
const queryFormState = {
const queryFormState = {
firmId: undefined,
year: new Date().getFullYear(),
quarter: Math.ceil((new Date().getMonth() + 1) / 3),
quarter: null,
pageNum: 1,
pageSize: 10
};
@ -341,11 +342,8 @@
// ---------------------------- ----------------------------
onMounted(() => {
console.log('律师报表页面 onMounted 被调用');
initYearOptions();
console.log('准备调用 queryData');
queryData();
console.log('onMounted 完成');
});
</script>

9
src/views/business/erp/service/lawyer-statistics-detail.vue

@ -127,6 +127,15 @@ const quarterOptions = ref([
{ value: 4, label: '第四季度' }
]);
//
function getCurrentQuarter() {
const month = new Date().getMonth() + 1;
if (month <= 3) return 1;
if (month <= 6) return 2;
if (month <= 9) return 3;
return 4;
}
//
function initYearOptions() {
const currentYear = new Date().getFullYear();

Loading…
Cancel
Save