| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- <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>
- </div>
- <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">
- <template v-slot:operation="scope">
- <el-button type="primary" link @click='agreementEdit(scope.operationData.id)'>明细</el-button>
- </template>
- <template v-slot:search="scope">
- <Sort :scope="scope.slotData" :globalSortKey="globalSortKey" :globalSortOrder="globalSortOrder"
- @update:sort="handleSortUpdate"></Sort>
- </template>
- <template #customSlot="{ bodyCell: { scope, column } }">
- <template v-if="column.prop == 'quoteOrderNum'">
- {{ scope.row.quoteOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'proxyCustomerOrderNum'">
- {{ scope.row.proxyCustomerOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'pcOrderNum'">
- {{ scope.row.pcOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'appOrderNum'">
- {{ scope.row.appOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'payPendingOrderNum'">
- {{ scope.row.payPendingOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'underwritRejectNum'">
- {{ scope.row.underwritRejectNum }} 笔
- </template>
- <template v-if="column.prop == 'underwritPassRate'">
- {{ scope.row.underwritPassRate }} %
- </template>
- <template v-if="column.prop == 'underwriteRate'">
- {{ scope.row.underwriteRate }} %
- </template>
- <template v-if="column.prop == 'additionalRecordingOrderNum'">
- {{ scope.row.additionalRecordingOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'additionalRecordingPendingApprovalOrderNum'">
- {{ scope.row.additionalRecordingPendingApprovalOrderNum }} 笔
- </template>
- <template v-if="column.prop == 'additionalRecordingApprovalOrderNum'">
- {{ scope.row.additionalRecordingApprovalOrderNum }} 笔
- </template>
- </template>
- </ComplexTable>
- <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 api from "@/api";
- import QueryForm from "../../components/queryForm.vue";
- import FilterDialog from "../../components/filterDialog.vue";
- import DowButton from "../../components/button.vue";
- import Sort from "../../components/sort.vue";
- import useUserStore from "@/store/modules/message";
- import PageInfo from "@/api/types/agreementTypes";
- import { ElMessage } from "element-plus";
- const router = useRouter();
- const userStore = useUserStore();
- const isShow = ref(false);
- const isSort = ref();
- const pageInfo = ref({
- pageNum: 1,
- pageSize: 10,
- sizes: [10, 20, 30, 40, 50],
- total: 0,
- });
- const listOption = reactive({
- rowKey: "channelId",
- //查询
- queryFormFields: [],
- // 表格列
- columns: [
- {
- prop: "salesmanName",
- label: "姓名",
- width: "100",
- },
- {
- prop: "salesmanPhone",
- label: "手机号",
- width: "120",
- },
- {
- prop: "deptName",
- label: "所属机构",
- width: "300",
- },
- {
- prop: "quoteOrderNum",
- label: "报价订单",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "proxyCustomerOrderNum",
- label: "代客录单",
- width: "180",
- align: "right",
- sortable: true,
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "pcOrderNum",
- label: "PC报价中",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "appOrderNum",
- label: "APP报价中",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "payPendingOrderNum",
- label: "待缴费",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "underwritRejectNum",
- label: "核保失败",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "underwritPassRate",
- label: "核保通过率",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "underwriteRate",
- label: "承保率",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "additionalRecordingOrderNum",
- label: "补录订单",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "additionalRecordingPendingApprovalOrderNum",
- label: "补录待审核",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "additionalRecordingApprovalOrderNum",
- label: "补录审核通过",
- width: "180",
- align: "right",
- sortable: true,
- component: "customSlot",
- },
- {
- prop: "manegerName",
- label: "管理人",
- width: "180",
- },
- ],
- });
- const selectedKeys = ref([]);
- const selected = function (val) {
- selectedKeys.value = val;
- };
- //查询数据
- const phone = JSON.parse(localStorage.getItem("userInfo")).username;
- //获取默认选择数据
- const queryFormRes = ref();
- const routerKey = ref("channelData");
- const defaultList = ref();
- const pageHiddenList = 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);
- selectedKeys.value = defaultList.value;
- queryFormRes.value = queryFormRef.value?.initDefaultSaveForm();
- queryList();
- };
- //删除
- const filterDialogRef = ref();
- const delSelect = (id) => {
- listOption.queryFormFields = listOption.queryFormFields.filter(
- (item) => item.id != id
- );
- filterDialogRef.value.initList(
- [...listOption.queryFormFields, ...pageHiddenList.value],
- defaultList.value
- );
- };
- //打开dialogShow
- const dialogShow = function () {
- isShow.value = true;
- filterDialogRef.value.initList(
- [...listOption.queryFormFields, ...pageHiddenList.value],
- defaultList.value
- );
- };
- //确定
- const queryFormRef = ref();
- const filterSure = (item, index) => {
- isShow.value = false;
- const secondGroupIds = item.list.map((item) => item.id);
- const oldList = listOption.queryFormFields.filter((item) =>
- secondGroupIds.includes(item.id)
- );
- const firstGroupIds = listOption.queryFormFields.map((item) => item.id);
- let newList = item.list.filter((item) => !firstGroupIds.includes(item.id));
- //过滤掉默认不显示的数据
- const hiddenList = new Set(pageHiddenList.value.map((item) => item.id));
- const filterList = newList.filter((item) => !hiddenList.has(item.id));
- listOption.queryFormFields = [...oldList, ...filterList];
- queryFormRef.value?.initDefaultSaveForm();
- selectedKeys.value = item.list.filter((item) => item.id);
- };
- const globalSortKey = ref("");
- const globalSortOrder = ref<"asc" | "desc">("asc");
- // 处理子组件传递的排序更新
- const handleSortUpdate = (sortInfo: {
- key: string;
- order: string;
- name: string;
- }) => {
- globalSortKey.value = sortInfo.key;
- globalSortOrder.value = sortInfo.order;
- queryList();
- };
- //查询
- const query = (item) => {
- queryFormRes.value = item;
- queryList();
- };
- //数据查询
- const tableData = ref([]);
- const queryList = async () => {
- let query = { ...queryFormRes.value };
- const { data } = await api.manageApi.channelDataPageList({
- 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,
- });
- tableData.value = data.records;
- pageInfo.value.pageNum = data.current;
- pageInfo.value.pageSize = data.size;
- pageInfo.value.total = data.total;
- };
- //分页事件
- function getList(item: PageInfo) {
- pageInfo.value.pageNum = item.pageNum;
- pageInfo.value.pageSize = item.pageSize;
- queryList();
- }
- //导出
- const downloadFile = async () => {
- let query = { ...queryFormRes.value };
- const { data, msg } = await api.manageApi.channelDataToTask({
- 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,
- });
- ElMessage({
- message: msg,
- type: "success",
- });
- userStore.count++;
- };
- const agreementEdit = (id) => {
- router.push({
- name: "channelDataDetail",
- query: {
- id: id,
- },
- });
- };
- onMounted(() => {
- initDefaultList();
- });
- </script>
- <style scoped lang="scss">
- .log {
- .query-btn {
- margin-left: 20px;
- }
- .btn-box {
- padding-bottom: 15px;
- margin-bottom: 24px;
- border-bottom: 1px solid #eeeeee;
- display: flex;
- justify-content: flex-end;
- }
- }
- :deep(.caret-wrapper) {
- display: none !important;
- }
- </style>
|