Commit 57df3931 authored by 沈翠玲's avatar 沈翠玲

案件分派汇总和全部案件增加导出按钮

parent f859370e
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
</div> </div>
</div> </div>
</div> </div>
<script src="/src/exceljs.min.js"></script>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"@element-plus/icons-vue": "^2.3.1", "@element-plus/icons-vue": "^2.3.1",
"@vitejs/plugin-vue-jsx": "^4.1.1", "@vitejs/plugin-vue-jsx": "^4.1.1",
"@vueuse/core": "^12.0.0", "@vueuse/core": "^12.0.0",
"@vxe-ui/plugin-export-xlsx": "4.0.7",
"@wangeditor/editor": "^5.1.23", "@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12", "@wangeditor/editor-for-vue": "^5.1.12",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.31.0", "eslint-plugin-vue": "^9.31.0",
"esno": "^4.8.0", "esno": "^4.8.0",
"exceljs": "4.4.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
......
import request from '@/utils/http/index';
export const getCollectorStatsVo = (params) => {
return request.get('/Loan/getCollectorStatsVo', params);
};
export const getCollectorNoDistributeStatsVo = (params) => {
return request.get('/Loan/getCollectorNoDistributeStatsVo', params);
};
export const getCollectorProvinceStatsVo = (params) => {
return request.get('/Loan/getCollectorProvinceStatsVo', params);
};
This diff is collapsed.
...@@ -21,7 +21,7 @@ import { ...@@ -21,7 +21,7 @@ import {
} from 'vxe-pc-ui'; } from 'vxe-pc-ui';
import { VxeTable, VxeColumn, VxeColgroup, VxeGrid, VxeToolbar } from 'vxe-table'; import { VxeTable, VxeColumn, VxeColgroup, VxeGrid, VxeToolbar } from 'vxe-table';
import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
// 导入主题变量,也可以重写主题变量 // 导入主题变量,也可以重写主题变量
import 'vxe-table/styles/cssvar.scss'; import 'vxe-table/styles/cssvar.scss';
import 'vxe-pc-ui/styles/cssvar.scss'; import 'vxe-pc-ui/styles/cssvar.scss';
...@@ -33,6 +33,7 @@ import zhCN from 'vxe-pc-ui/lib/language/zh-CN'; ...@@ -33,6 +33,7 @@ import zhCN from 'vxe-pc-ui/lib/language/zh-CN';
VxeUI.setI18n('zh-CN', zhCN); VxeUI.setI18n('zh-CN', zhCN);
VxeUI.setLanguage('zh-CN'); VxeUI.setLanguage('zh-CN');
VxeUI.use(VxeUIPluginExportXLSX);
// 可选组件 // 可选组件
function lazyVxeUI(app) { function lazyVxeUI(app) {
......
<template>
<div class="table-box">
<div class="bg-white pt-2 pl-2">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane
:label="item.label"
:name="item.value"
v-for="(item, index) in tabs"
:key="index"
>
</el-tab-pane>
</el-tabs>
</div>
<div>
<ProTable
:config="config"
v-if="firstLoad"
ref="caseLRef"
:api="fn"
:showPagination="false"
:paramCallback="paramCallback"
:dataCallback="dataCallback"
>
<template #left_buttons>
<el-button type="primary" @click="exportEvent">导出</el-button>
</template>
</ProTable>
</div>
</div>
</template>
<script setup name="case-audit" lang="jsx">
import { Download } from '@element-plus/icons-vue';
import { inject, nextTick } from 'vue';
import { computed } from 'vue';
import { ElMessageBox, ElMessage, ElButton, ElTag } from 'element-plus';
import { onMounted } from 'vue';
import { getAppEnvConfig } from '@/utils/env';
import { getCollectorStatsVo, getCollectorNoDistributeStatsVo, getCollectorProvinceStatsVo } from '@/api/analy';
import { useUserStore } from '@/stores/modules/user';
import { getTenantPage } from '@/api/tenant';
import { useDict } from '@/hooks/useDict';
const { PhoneResultStatus, ReduceType, FlowStatus, FollowStatus, AuditStatus, CaseStatus } =
useDict(
'PhoneResultStatus',
'ReduceType',
'FlowStatus',
'FollowStatus',
'AuditStatus',
'CaseStatus'
);
const envs = getAppEnvConfig();
const { userInfo } = useUserStore();
import { reactive, ref } from 'vue';
const downloadfile = inject('download');
const allocationModalRef = ref();
const firstLoad = ref(false);
const caseLRef = ref();
const selectdList = ref([]);
const tabs = ref([
{label: '催员持案汇总',value: '催员持案汇总'},
{label: '未分派案件汇总',value: '未分派案件汇总'},
{label: '属地分派汇总',value: '属地分派汇总'}
]);
const sheetMethod = ({ options, worksheet }) => {
const data = options.data;
const columns = options.columns;
console.log('asdas',options, worksheet)
}
const exportEvent = () => {
if (caseLRef.value && caseLRef.value.element) {
caseLRef.value.element.exportData({
type: 'xlsx',
useStyle: true,
sheetMethod: sheetMethod,
isColgroup: true,
isMerge: true,
isHeader: true
});
}
};
const activeName = ref('催员持案汇总');
const fn = (params) => {
if (activeName.value === '催员持案汇总') {
return getCollectorStatsVo(params)
} else if (activeName.value === '未分派案件汇总') {
return getCollectorNoDistributeStatsVo(params)
} else {
return getCollectorProvinceStatsVo(params)
}
}
const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param));
return obj;
};
const handleClick = () => {
setTimeout(() => {
query();
}, 300);
};
const config = reactive({
columns: [
]
})
const dataCallback = (data) => {
console.log('data', data)
if (activeName.value === '催员持案汇总' || activeName.value === '未分派案件汇总') {
if (data.length > 0) {
const key = data[0]['platforms'] ? 'platforms' : 'batchCodeDetailVos'
data[0][key].reverse()
data[0][key].forEach((item, index) => {
config['columns'].push({
title: item.platformName,
showOverflow: 'tooltip',
children: [
{ sortable: true, field: `${key}[${index}].totalAmount`, title: '金额', width: 140},
{ field: `${key}[${index}].borrowerCount`, title: '户数', width: 120 },
{ field: `${key}[${index}].avgAmount`, title: '户均', width: 120 }
]
})
})
}
} else {
if (data.length > 0) {
const key = 'provinceDetailVoList'
data[0][key].reverse()
data[0][key].forEach((item, index) => {
config['columns'].push({
title: item.platformName,
showOverflow: 'tooltip',
children: [
{ sortable: true, field: `${key}[${index}].disAmount`, title: '已分派', width: 140},
{ field: `${key}[${index}].noDisAmount`, title: '未分派', width: 120 },
{ field: `${key}[${index}].totalAmount`, title: '合计', width: 120 }
]
})
})
}
}
return data
}
const download = (item) => {
const name = item.slice(item.lastIndexOf('/') + 1, item.length);
downloadfile('/sys/static/' + item, {}, name);
};
const query = () => {
firstLoad.value = false
if (activeName.value === '催员持案汇总') {
config['columns'] = [{
title: '催员姓名',
field: 'collectorName',
showOverflow: 'tooltip',
width: 120,
search: { el: 'input', props: { clearable: true }, key: 'cpeName', labelWidth: 105 },
},
{
showOverflow: 'tooltip',
field: 'tenantName',
enum: () => getTenantPage({ current: 1, size: 999999999, status: 'enable' }),
search: { el: 'select', props: { filterable: true }, key: 'tenant', labelWidth: 105 },
fieldNames: { label: 'name', value: 'id' },
title: '调解中心',
width: 120,
}]
} else if (activeName.value === '未分派案件汇总') {
config['columns'] = [{
title: '委案类型',
field: 'batchCode',
showOverflow: 'tooltip',
width: 100
}]
} else {
config['columns'] = [{
title: '属地',
field: 'province',
showOverflow: 'tooltip',
width: 100
}]
}
nextTick(() => {
firstLoad.value = true
})
setTimeout(()=> {
caseLRef.value?.search();
}, 500)
};
onMounted(() => {
query();
});
</script>
\ No newline at end of file
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
</div> </div>
</div> </div>
</template> </template>
<template #left_buttons>
<el-button type="primary" @click="download" v-permission="'caseManageExport'">导出</el-button>
</template>
</ProTable> </ProTable>
</div> </div>
<caseModal ref="caseModalRef" /> <caseModal ref="caseModalRef" />
...@@ -59,7 +62,10 @@ ...@@ -59,7 +62,10 @@
const caseModalRef = ref(); const caseModalRef = ref();
const caseLRef = ref(); const caseLRef = ref();
const statisis = ref({}); const statisis = ref({});
const paramsStatic = ref({});
const { authButtonListGet } = useAuthStore(); // 获取用户权限列表 const { authButtonListGet } = useAuthStore(); // 获取用户权限列表
import { inject } from 'vue';
const downloadfile = inject('download');
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { getPlatformPage } from '@/api/platform'; import { getPlatformPage } from '@/api/platform';
...@@ -115,9 +121,13 @@ ...@@ -115,9 +121,13 @@
if (obj['tenantTime'][1]) obj['tenantTimeEnd'] = obj['tenantTime'][1]; if (obj['tenantTime'][1]) obj['tenantTimeEnd'] = obj['tenantTime'][1];
delete obj['tenantTime']; delete obj['tenantTime'];
} }
paramsStatic.value = obj
getStatisis(obj); getStatisis(obj);
return obj; return obj;
}; };
const download = (row) => {
downloadfile('/LoanExcel/download', paramsStatic.value, '资产列表.xls');
};
const config = reactive({ const config = reactive({
columns: [ columns: [
{ {
......
...@@ -55,9 +55,9 @@ export default defineConfig(({ command, mode }) => { ...@@ -55,9 +55,9 @@ export default defineConfig(({ command, mode }) => {
port: VITE_PORT, port: VITE_PORT,
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://192.168.31.187:8080', target: 'http://192.168.31.187:8080',
// target: 'http://192.168.31.128:8080', // target: 'http://192.168.31.128:8080',
target: 'http://8.152.205.9:8080', // target: 'http://8.152.205.9:8080',
ws:true, ws:true,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment