|
@@ -2,7 +2,7 @@
|
|
|
<div class="statistics-order-center-count-container layout-pd">
|
|
|
<!-- 搜索 -->
|
|
|
<el-card shadow="never">
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
<el-form-item label="姓名" prop="Keyword">
|
|
|
<el-input v-model="state.queryParams.Keyword" placeholder="姓名" clearable @keyup.enter="handleQuery" class="keyword-input" />
|
|
|
</el-form-item>
|
|
@@ -17,7 +17,7 @@
|
|
|
:shortcuts="shortcuts"
|
|
|
@change="handleQuery"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
- :clearable="false"
|
|
|
+ :clearable="false"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -29,23 +29,21 @@
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
<el-card shadow="never">
|
|
|
- <ProTable
|
|
|
- ref="proTableRef"
|
|
|
- :columns="columns"
|
|
|
- :data="state.tableData"
|
|
|
- @updateTable="queryList"
|
|
|
- :loading="state.loading"
|
|
|
- show-summary
|
|
|
- border
|
|
|
- row-key="orgId"
|
|
|
- @sort-change="sortChange"
|
|
|
- :total="state.total"
|
|
|
- v-model:page-index="state.queryParams.PageIndex"
|
|
|
- v-model:page-size="state.queryParams.PageSize"
|
|
|
- :summary-method="getSummaries"
|
|
|
- role-key="userId"
|
|
|
- >
|
|
|
- </ProTable>
|
|
|
+ <ProTable
|
|
|
+ ref="proTableRef"
|
|
|
+ :columns="columns"
|
|
|
+ :data="state.tableData"
|
|
|
+ @updateTable="queryList"
|
|
|
+ :loading="state.loading"
|
|
|
+ show-summary
|
|
|
+ border
|
|
|
+ row-key="orgId"
|
|
|
+ @sort-change="sortChange"
|
|
|
+ :pagination="false"
|
|
|
+ :summary-method="getSummaries"
|
|
|
+ role-key="userId"
|
|
|
+ >
|
|
|
+ </ProTable>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -53,29 +51,35 @@
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
import { FormInstance } from 'element-plus';
|
|
|
import { centerList } from '@/api/statistics/order';
|
|
|
-import { defaultDate, shortcuts } from "@/utils/constants";
|
|
|
+import { defaultDate, shortcuts } from '@/utils/constants';
|
|
|
|
|
|
// 表格配置项
|
|
|
const columns = ref<any[]>([
|
|
|
- { type: 'index', fixed: 'left', width: 55, label: '序号', align: 'center' },
|
|
|
- { prop: 'userName', label: '姓名', align: 'center' },
|
|
|
- { label: '有效件', align: 'center',prop:'effective', _children: [
|
|
|
- { prop: 'centreArchive', label: '中心归档件', align: 'center', sortable: 'custom' },
|
|
|
- { prop: 'centreCareOf', label: '转办信件', align: 'center', sortable: 'custom' }
|
|
|
- ] },
|
|
|
- { prop: 'invalid', label: '无效信件', align: 'center', sortable: 'custom' },
|
|
|
- { prop: 'repeat', label: '重复信件', align: 'center', sortable: 'custom' },
|
|
|
- { prop: 'subtotal', label: '所有信件', align: 'center', sortable: 'custom' },
|
|
|
+ { type: 'index', fixed: 'left', width: 55, label: '序号', align: 'center' },
|
|
|
+ { prop: 'userName', label: '姓名', align: 'center' },
|
|
|
+ {
|
|
|
+ label: '有效件',
|
|
|
+ align: 'center',
|
|
|
+ prop: 'effective',
|
|
|
+ _children: [
|
|
|
+ { prop: 'centreArchive', label: '中心归档件', align: 'center', sortable: 'custom' },
|
|
|
+ { prop: 'centreCareOf', label: '转办信件', align: 'center', sortable: 'custom' },
|
|
|
+ { prop: 'noCentreCareOf', label: '待转办信件', align: 'center', sortable: 'custom' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ { prop: 'invalid', label: '无效信件', align: 'center', sortable: 'custom' },
|
|
|
+ { prop: 'repeat', label: '重复信件', align: 'center', sortable: 'custom' },
|
|
|
+ { prop: 'subtotal', label: '所有信件', align: 'center', sortable: 'custom' },
|
|
|
]);
|
|
|
// 定义变量内容
|
|
|
const ruleFormRef = ref<RefType>(); // 表单ref
|
|
|
const state = reactive({
|
|
|
queryParams: {
|
|
|
// 查询条件
|
|
|
- PageIndex: 1,
|
|
|
- PageSize: 10,
|
|
|
Keyword: null, // 关键词
|
|
|
- crTime: defaultDate
|
|
|
+ crTime: defaultDate,
|
|
|
+ SortField: null,
|
|
|
+ SortRule: null,
|
|
|
},
|
|
|
tableData: [], //表单
|
|
|
loading: false, // 加载
|
|
@@ -83,8 +87,8 @@ const state = reactive({
|
|
|
});
|
|
|
/** 搜索按钮操作 */
|
|
|
const handleQuery = () => {
|
|
|
- state.queryParams.PageIndex = 1;
|
|
|
- queryList();
|
|
|
+ // state.queryParams.PageIndex = 1;
|
|
|
+ queryList();
|
|
|
};
|
|
|
/** 获取列表 */
|
|
|
const queryList = () => {
|
|
@@ -98,23 +102,19 @@ const queryList = () => {
|
|
|
const request = {
|
|
|
StartTime,
|
|
|
EndTime,
|
|
|
- DelayState: state.queryParams.DelayState,
|
|
|
- PageIndex: state.queryParams.PageIndex,
|
|
|
- PageSize: state.queryParams.PageSize,
|
|
|
Keyword: state.queryParams.Keyword,
|
|
|
SortField: state.queryParams.SortField,
|
|
|
SortRule: state.queryParams.SortRule,
|
|
|
};
|
|
|
centerList(request)
|
|
|
.then((res: any) => {
|
|
|
- state.tableData = res.result?.items ?? [];
|
|
|
- state.total = res.result?.total ?? 0;
|
|
|
+ state.tableData = res.result;
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
|
});
|
|
|
-}
|
|
|
+};
|
|
|
// 排序
|
|
|
const sortChange = (val: any) => {
|
|
|
state.queryParams.SortField = val.order ? val.prop : null;
|
|
@@ -127,35 +127,35 @@ const resetQuery = (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
formEl.resetFields();
|
|
|
queryList();
|
|
|
-}
|
|
|
+};
|
|
|
// 合计
|
|
|
const getSummaries = (param: any) => {
|
|
|
- const { columns, data } = param;
|
|
|
- const sums: string[] = [];
|
|
|
- columns.forEach((column: { property: string }, index: number) => {
|
|
|
- if (index === 0) {
|
|
|
- sums[index] = '合计';
|
|
|
- return;
|
|
|
- }
|
|
|
- const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
|
|
|
- if (['userName'].includes(column.property)) {
|
|
|
- //百分比不能计算
|
|
|
- sums[index] = '';
|
|
|
- return '';
|
|
|
- } else if (!values.every((value: unknown) => Number.isNaN(value))) {
|
|
|
- sums[index] = `${values.reduce((prev: any, curr: any) => {
|
|
|
- const value = Number(curr);
|
|
|
- if (!Number.isNaN(value)) {
|
|
|
- return prev + curr;
|
|
|
- } else {
|
|
|
- return prev;
|
|
|
- }
|
|
|
- }, 0)}`;
|
|
|
- } else {
|
|
|
- sums[index] = ' ';
|
|
|
- }
|
|
|
- });
|
|
|
- return sums;
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums: string[] = [];
|
|
|
+ columns.forEach((column: { property: string }, index: number) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
|
|
|
+ if (['userName'].includes(column.property)) {
|
|
|
+ //百分比不能计算
|
|
|
+ sums[index] = '';
|
|
|
+ return '';
|
|
|
+ } else if (!values.every((value: unknown) => Number.isNaN(value))) {
|
|
|
+ sums[index] = `${values.reduce((prev: any, curr: any) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!Number.isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)}`;
|
|
|
+ } else {
|
|
|
+ sums[index] = ' ';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|