|
|
@@ -1,33 +1,33 @@
|
|
|
<template>
|
|
|
<div class="log">
|
|
|
<PageMain class="vh100">
|
|
|
- <div class='btn-box'>
|
|
|
- <el-button type="primary" plain class='query-btn'
|
|
|
- @click='dialogShow'>{{selectedKeys.length?`已选${selectedKeys.length}项`:'筛选条件'}}</el-button>
|
|
|
- <div class='query-btn'>
|
|
|
- <DowButton @endAnim='downloadFile'></DowButton>
|
|
|
+ <div class='btn-box'>
|
|
|
+ <el-button type="primary" plain class='query-btn'
|
|
|
+ @click='dialogShow'>{{ selectedKeys.length ? `已选${selectedKeys.length}项` : '筛选条件' }}</el-button>
|
|
|
+ <div class='query-btn'>
|
|
|
+ <DowButton @endAnim='downloadFile'></DowButton>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <QueryForm :option="listOption" @query='query' @delSelect='delSelect' ref='queryFormRef'></QueryForm>
|
|
|
+ <QueryForm :option="listOption" @query='query' @delSelect='delSelect' ref='queryFormRef'></QueryForm>
|
|
|
|
|
|
- <!-- 表格 -->
|
|
|
- <ComplexTable :tableData="tableData" :showSelect='false' :columns="listOption.columns" :showIndex="false"
|
|
|
- :columnwidth="120" :pageInfo="pageInfo" @getList="getList" :showOperation='false'>
|
|
|
- <template v-slot:search="scope">
|
|
|
- <Sort :scope="scope.slotData" :globalSortKey="globalSortKey" :globalSortOrder="globalSortOrder"
|
|
|
- @update:sort="handleSortUpdate"></Sort>
|
|
|
- </template>
|
|
|
- </ComplexTable>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <ComplexTable :tableData="tableData" :showSelect='false' :columns="listOption.columns" :showIndex="false"
|
|
|
+ :columnwidth="120" :pageInfo="pageInfo" @getList="getList" :showOperation='false'>
|
|
|
+ <template v-slot:search="scope">
|
|
|
+ <Sort :scope="scope.slotData" :globalSortKey="globalSortKey" :globalSortOrder="globalSortOrder"
|
|
|
+ @update:sort="handleSortUpdate"></Sort>
|
|
|
+ </template>
|
|
|
+ </ComplexTable>
|
|
|
|
|
|
- <FilterDialog :show='isShow' @close='isShow=false' @sure='filterSure' ref='filterDialogRef' @selectedKeys='selected'
|
|
|
- routerKey='routerKey'>
|
|
|
- </FilterDialog>
|
|
|
+ <FilterDialog :show='isShow' @close='isShow = false' @sure='filterSure' ref='filterDialogRef'
|
|
|
+ @selectedKeys='selected' routerKey='routerKey'>
|
|
|
+ </FilterDialog>
|
|
|
</PageMain>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useRouter } from "vue-router";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
import api from "@/api";
|
|
|
import QueryForm from "../../components/queryForm.vue";
|
|
|
import FilterDialog from "../../components/filterDialog.vue";
|
|
|
@@ -37,7 +37,7 @@ import useUserStore from "@/store/modules/message";
|
|
|
import PageInfo from "@/api/types/agreementTypes";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
|
|
|
-const router = useRouter();
|
|
|
+const route = useRoute();
|
|
|
const userStore = useUserStore();
|
|
|
const isShow = ref(false);
|
|
|
|
|
|
@@ -55,12 +55,12 @@ const listOption = reactive({
|
|
|
// 表格列
|
|
|
columns: [
|
|
|
{
|
|
|
- prop: "salesmanName",
|
|
|
+ prop: "name",
|
|
|
label: "业务员",
|
|
|
- width: "100",
|
|
|
+ width: "120",
|
|
|
},
|
|
|
{
|
|
|
- prop: "salesmanPhone",
|
|
|
+ prop: "mobile",
|
|
|
label: "手机号",
|
|
|
width: "120",
|
|
|
},
|
|
|
@@ -70,7 +70,7 @@ const listOption = reactive({
|
|
|
width: "120",
|
|
|
},
|
|
|
{
|
|
|
- prop: "partnerCompanyName",
|
|
|
+ prop: "partnerCompany",
|
|
|
label: "合作保险公司",
|
|
|
width: "300",
|
|
|
},
|
|
|
@@ -85,24 +85,24 @@ const listOption = reactive({
|
|
|
width: "180",
|
|
|
},
|
|
|
{
|
|
|
- prop: "orderTypeName",
|
|
|
+ prop: "entryStatus",
|
|
|
label: "订单类型",
|
|
|
width: "180",
|
|
|
},
|
|
|
{
|
|
|
- prop: "riskName",
|
|
|
+ prop: "productName",
|
|
|
label: "险种",
|
|
|
width: "180",
|
|
|
},
|
|
|
{
|
|
|
- prop: "sumPremium",
|
|
|
+ prop: "premium",
|
|
|
label: "保费",
|
|
|
width: "180",
|
|
|
align: "right",
|
|
|
sortable: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: "orderCommissionPremium",
|
|
|
+ prop: "commission",
|
|
|
label: "出单佣金",
|
|
|
width: "180",
|
|
|
align: "right",
|
|
|
@@ -114,15 +114,15 @@ const listOption = reactive({
|
|
|
width: "180",
|
|
|
},
|
|
|
{
|
|
|
- prop: "recordTime",
|
|
|
+ prop: "signTime",
|
|
|
label: "签单时间",
|
|
|
width: "180",
|
|
|
},
|
|
|
- {
|
|
|
- prop: "manegerName",
|
|
|
- label: "管理人",
|
|
|
- width: "180",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: "manegerName",
|
|
|
+ // label: "管理人",
|
|
|
+ // width: "180",
|
|
|
+ // },
|
|
|
],
|
|
|
});
|
|
|
|
|
|
@@ -139,20 +139,46 @@ const queryFormRes = ref();
|
|
|
const routerKey = ref("salesmanReportDetail");
|
|
|
const defaultList = ref();
|
|
|
const pageHiddenList = ref([]); //页面不显示的数据
|
|
|
+const isFilterFrom = ref(); //主页面查询条件且在过滤中不存在
|
|
|
+
|
|
|
const initDefaultList = async () => {
|
|
|
const { data } = await api.manageApi.getSearchDefaultList({
|
|
|
routerKey: routerKey.value,
|
|
|
userId: phone,
|
|
|
});
|
|
|
- listOption.queryFormFields = data.filter((e) => e.showFlag);
|
|
|
|
|
|
- pageHiddenList.value = data.filter((e) => !e.showFlag);
|
|
|
- defaultList.value = data.map((e) => e.id);
|
|
|
+ const queryParamsMap = route.query;
|
|
|
+ const processedData = data.map((item) => {
|
|
|
+ if (queryParamsMap.hasOwnProperty(item.key)) {
|
|
|
+ let defaultValue = queryParamsMap[item.key]
|
|
|
+ return { ...item, defaultValue };
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+
|
|
|
+ let filterFrom = {};
|
|
|
+ processedData.map((item) => {
|
|
|
+ filterFrom[item.key] = item.defaultValue;
|
|
|
+ });
|
|
|
+ isFilterFrom.value = getUniqueProperties(queryParamsMap, filterFrom);
|
|
|
+
|
|
|
+ listOption.queryFormFields = processedData.filter((e) => e.showFlag);
|
|
|
+ pageHiddenList.value = processedData.filter((e) => !e.showFlag);
|
|
|
+ defaultList.value = processedData.map((e) => e.id);
|
|
|
selectedKeys.value = defaultList.value;
|
|
|
queryFormRes.value = queryFormRef.value?.initDefaultSaveForm();
|
|
|
queryList();
|
|
|
};
|
|
|
|
|
|
+const getUniqueProperties = (obj1, obj2) => {
|
|
|
+ const uniqueProps = {};
|
|
|
+ Object.keys(obj1).forEach((key) => {
|
|
|
+ if (!(key in obj2) || obj2[key] == undefined) {
|
|
|
+ uniqueProps[key] = obj1[key];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return uniqueProps;
|
|
|
+};
|
|
|
//删除
|
|
|
const filterDialogRef = ref();
|
|
|
const delSelect = (id) => {
|
|
|
@@ -216,16 +242,19 @@ const query = (item) => {
|
|
|
//数据查询
|
|
|
const tableData = ref([]);
|
|
|
const queryList = async () => {
|
|
|
- let query = { ...queryFormRes.value };
|
|
|
+ let query = { ...queryFormRes.value, ...isFilterFrom.value };
|
|
|
const { data } = await api.manageApi.salesmanReportDetailPageList({
|
|
|
pageNo: pageInfo.value.pageNum,
|
|
|
pageSize: pageInfo.value.pageSize,
|
|
|
routerKey: routerKey.value,
|
|
|
+ systemCode: localStorage.getItem('login_system'),
|
|
|
userId: phone,
|
|
|
orderType: globalSortKey.value
|
|
|
? globalSortKey.value + " " + globalSortOrder.value
|
|
|
: "",
|
|
|
...query,
|
|
|
+ signTimeBegin: query.signTime[0] ?? '',
|
|
|
+ signTimeEnd: query.signTime[1] ?? '',
|
|
|
});
|
|
|
tableData.value = data.records;
|
|
|
pageInfo.value.pageNum = data.current;
|
|
|
@@ -242,16 +271,19 @@ function getList(item: PageInfo) {
|
|
|
|
|
|
//导出
|
|
|
const downloadFile = async () => {
|
|
|
- let query = { ...queryFormRes.value };
|
|
|
+ let query = { ...queryFormRes.value, ...isFilterFrom.value };
|
|
|
const { data, msg } = await api.manageApi.salesmanReportDetailToTask({
|
|
|
pageNo: pageInfo.value.pageNum,
|
|
|
pageSize: pageInfo.value.pageSize,
|
|
|
routerKey: routerKey.value,
|
|
|
+ systemCode: localStorage.getItem('login_system'),
|
|
|
userId: phone,
|
|
|
orderType: globalSortKey.value
|
|
|
? globalSortKey.value + " " + globalSortOrder.value
|
|
|
: "",
|
|
|
...query,
|
|
|
+ signTimeBegin: query.signTime[0] ?? '',
|
|
|
+ signTimeEnd: query.signTime[1] ?? '',
|
|
|
});
|
|
|
ElMessage({
|
|
|
message: msg,
|
|
|
@@ -270,6 +302,7 @@ onMounted(() => {
|
|
|
.query-btn {
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
+
|
|
|
.btn-box {
|
|
|
padding-bottom: 15px;
|
|
|
margin-bottom: 24px;
|
|
|
@@ -278,6 +311,7 @@ onMounted(() => {
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
:deep(.caret-wrapper) {
|
|
|
display: none !important;
|
|
|
}
|