|
|
@@ -1,170 +1,417 @@
|
|
|
<template>
|
|
|
<div class="log">
|
|
|
- <el-form label-width="100" label-position="left" :model="form">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="操作人">
|
|
|
- <el-input v-model="form.operator" placeholder="请输入操作人姓名查找"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="操作时间">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.operatingTime"
|
|
|
- type="daterange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始时间"
|
|
|
- end-placeholder="结束时间"
|
|
|
- format="YYYY-MM-DD"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- @change="timeChange"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="操作功能">
|
|
|
- <el-select v-model="form.function" placeholder="请选择">
|
|
|
- <el-option label="工能1" value="1" key="1"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="操作内容">
|
|
|
- <el-input v-model="form.content" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16" style="display: flex; align-items: center; justify-content: flex-end">
|
|
|
- <el-button type="primary" @click="search">查询</el-button>
|
|
|
- <el-button plain type="primary" @click="reset">重置</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- height="600"
|
|
|
- style="margin-top: 24px"
|
|
|
- >
|
|
|
- <el-table-column label="操作人" prop="createBy" width="200"></el-table-column >
|
|
|
- <el-table-column label="操作时间" prop="createTime" width="240"></el-table-column>
|
|
|
- <el-table-column label="操作功能" prop="moduleName"></el-table-column>
|
|
|
- <el-table-column label="操作内容" prop="operationContent"></el-table-column>
|
|
|
- <el-table-column label="类型" prop="operatorName" width="150"></el-table-column>
|
|
|
- <el-table-column label="操作" width="150">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary" @click="detail(scope.row)">查看详情</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="pagination">
|
|
|
- <el-pagination
|
|
|
- v-model:current-page="pages"
|
|
|
- v-model:page-size="size"
|
|
|
- :page-sizes="[10, 20, 30, 40]"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- ></el-pagination>
|
|
|
+ <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>
|
|
|
+ <div class='flex content-box'>
|
|
|
+ <!-- tree -->
|
|
|
+ <div>
|
|
|
+ <div class='content-l'>
|
|
|
+ <div class='item' v-for='(item,index) in tabList' :key="index" :class="{'active':index==tabIndex}"
|
|
|
+ @click='tabClick(item,index)'>
|
|
|
+ {{item.name}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Tree ref='treeRef'></Tree>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class='flex-1 content-r'>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <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 == 'underwriteOrderNum'">
|
|
|
+ {{ scope.row.underwriteOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ <template v-if="column.prop == 'djOrderNum'">
|
|
|
+ {{ scope.row.djOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ <template v-if="column.prop == 'dsyOrderNum'">
|
|
|
+ {{ scope.row.dsyOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ <template v-if="column.prop == 'dszOrderNum'">
|
|
|
+ {{ scope.row.dszOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ <template v-if="column.prop == 'jszOrderNum'">
|
|
|
+ {{ scope.row.jszOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ <template v-if="column.prop == 'jsyOrderNum'">
|
|
|
+ {{ scope.row.jsyOrderNum }} 笔
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </ComplexTable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <FilterDialog :show='isShow' @close='isShow=false' @sure='filterSure' ref='filterDialogRef' @selectedKeys='selected'
|
|
|
+ routerKey='routerKey'>
|
|
|
+ </FilterDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
-import api from '@/api'
|
|
|
-import {ElMessage} from "element-plus";
|
|
|
+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 Tree from "../../components/tree.vue";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
|
-const myRouter = useRouter()
|
|
|
+const router = useRouter();
|
|
|
+const userStore = useUserStore();
|
|
|
+const isShow = ref(false);
|
|
|
|
|
|
-let activeName = ref('first')
|
|
|
-const handleClick = () => {
|
|
|
+const isSort = ref();
|
|
|
+const pageInfo = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ sizes: [10, 20, 30, 40, 50],
|
|
|
+ total: 0,
|
|
|
+});
|
|
|
+const listOption = reactive({
|
|
|
+ rowKey: "telemarketingId",
|
|
|
+ //查询
|
|
|
+ queryFormFields: [],
|
|
|
+ // 表格列
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ prop: "salesmanName",
|
|
|
+ label: "姓名",
|
|
|
+ width: "100",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "salesmanPhone",
|
|
|
+ label: "手机号",
|
|
|
+ width: "120",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "deptName",
|
|
|
+ label: "所属机构",
|
|
|
+ width: "300",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "underwriteOrderNum",
|
|
|
+ label: "承保订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "sumPremium",
|
|
|
+ label: "保费",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "jqPremium",
|
|
|
+ label: "交强保费",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "taxPremium",
|
|
|
+ label: "车船税",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "syPremium",
|
|
|
+ label: "商业保费",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "jyPremium",
|
|
|
+ label: "驾意保费",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "djOrderNum",
|
|
|
+ label: "单交订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "dsyOrderNum",
|
|
|
+ label: "单商订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "dszOrderNum",
|
|
|
+ label: "单三订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "jszOrderNum",
|
|
|
+ label: "交三订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "jsyOrderNum",
|
|
|
+ label: "交商订单",
|
|
|
+ width: "180",
|
|
|
+ align: "right",
|
|
|
+ sortable: true,
|
|
|
+ component: "customSlot",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "manegerName",
|
|
|
+ label: "管理人",
|
|
|
+ width: "180",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+});
|
|
|
|
|
|
-}
|
|
|
+const selectedKeys = ref([]);
|
|
|
+const selected = function (val) {
|
|
|
+ selectedKeys.value = val;
|
|
|
+};
|
|
|
|
|
|
-let form = ref({})
|
|
|
-const tableProps = ref({
|
|
|
- value: "id",
|
|
|
- label: "name",
|
|
|
- children: "children",
|
|
|
- checkStrictly: true,
|
|
|
-});
|
|
|
-let option = ref([])
|
|
|
-const timeChange = (val) => {
|
|
|
+//查询数据
|
|
|
+const phone = JSON.parse(localStorage.getItem("userInfo")).username;
|
|
|
|
|
|
-}
|
|
|
-// 搜索
|
|
|
-const search = () => {
|
|
|
- pages.value = 1
|
|
|
- size.value = 10
|
|
|
- initData()
|
|
|
-}
|
|
|
-const reset = () => {
|
|
|
- form.value = {}
|
|
|
- pages.value = 1
|
|
|
- size.value = 10
|
|
|
- initData()
|
|
|
+//获取默认选择数据
|
|
|
+const queryFormRes = ref();
|
|
|
+const routerKey = ref("telemarketingDataManage");
|
|
|
+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.telemarketingDataManagePageList({
|
|
|
+ pageNo: pageInfo.value.pageNum,
|
|
|
+ pageSize: pageInfo.value.pageSize,
|
|
|
+ routerKey: routerKey.value,
|
|
|
+ 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();
|
|
|
}
|
|
|
|
|
|
-// 列表
|
|
|
-let tableData = ref([])
|
|
|
-const detail = (row) => {
|
|
|
- myRouter.push({
|
|
|
- path: '/consoleManage/businessDataManage/telemarketingDataManage/telemarketingDataManageDetail',
|
|
|
+//导出
|
|
|
+const downloadFile = async () => {
|
|
|
+ let query = { ...queryFormRes.value };
|
|
|
+ const { data, msg } = await api.manageApi.telemarketingDataManageToTask({
|
|
|
+ pageNo: pageInfo.value.pageNum,
|
|
|
+ pageSize: pageInfo.value.pageSize,
|
|
|
+ routerKey: routerKey.value,
|
|
|
+ userId: phone,
|
|
|
+ orderType: globalSortKey.value
|
|
|
+ ? globalSortKey.value + " " + globalSortOrder.value
|
|
|
+ : "",
|
|
|
+ ...query,
|
|
|
+ });
|
|
|
+ ElMessage({
|
|
|
+ message: msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ userStore.count++;
|
|
|
+};
|
|
|
+
|
|
|
+const agreementEdit = (id) => {
|
|
|
+ router.push({
|
|
|
+ name: "telemarketingDataManageDetail",
|
|
|
query: {
|
|
|
- id: row.id
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
+ id: id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
-// 分页
|
|
|
-let pages = ref(1)
|
|
|
-let size = ref(10)
|
|
|
-let total = ref(0)
|
|
|
-const handleSizeChange = (size) => {
|
|
|
- size.value = size
|
|
|
- initData()
|
|
|
-}
|
|
|
-const handleCurrentChange = (page) => {
|
|
|
- pages.value = page
|
|
|
- initData()
|
|
|
-}
|
|
|
+//tabClick
|
|
|
+const treeRef = ref();
|
|
|
+const tabIndex = ref(0);
|
|
|
+const tabClick = (item, index) => {
|
|
|
+ tabIndex.value = index;
|
|
|
+ treeRef.value?.getTree(item.api);
|
|
|
+};
|
|
|
|
|
|
-const initData = () => {
|
|
|
- api.logApi.list({
|
|
|
- pages: pages.value,
|
|
|
- size: size.value,
|
|
|
- ...form.value
|
|
|
- }).then((res: any) => {
|
|
|
- if(res.code === 200) {
|
|
|
- tableData.value = res.data.records
|
|
|
- total.value = res.data.total
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: res.msg,
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
+const tabList = ref([
|
|
|
+ {
|
|
|
+ name: "机构",
|
|
|
+ value: 1,
|
|
|
+ api: api.manageApi.getDeptListByUserId,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "人员",
|
|
|
+ value: 2,
|
|
|
+ api: api.manageApi.getUserManageListByUserId,
|
|
|
+ },
|
|
|
+]);
|
|
|
|
|
|
onMounted(() => {
|
|
|
- initData()
|
|
|
-})
|
|
|
-
|
|
|
+ initDefaultList();
|
|
|
+ treeRef.value?.getTree(tabList.value[0].api);
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-.log{
|
|
|
+.log {
|
|
|
width: 100%;
|
|
|
height: calc(100vh - 120px);
|
|
|
- background: #FFFFFF;
|
|
|
+ background: #ffffff;
|
|
|
padding: 24px;
|
|
|
overflow-y: auto;
|
|
|
- .pagination{
|
|
|
- margin-top: 24px;
|
|
|
+ .query-btn {
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ .btn-box {
|
|
|
+ padding-bottom: 15px;
|
|
|
+ margin-bottom: 24px;
|
|
|
+ border-bottom: 1px solid #eeeeee;
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
+
|
|
|
+ .content-box {
|
|
|
+ justify-content: space-between;
|
|
|
+ .content-l {
|
|
|
+ width: 298px;
|
|
|
+ display: flex;
|
|
|
+ margin: 20px 16px 20px 0;
|
|
|
+ .item {
|
|
|
+ width: 50%;
|
|
|
+ height: 36px;
|
|
|
+ line-height: 36px;
|
|
|
+ background: #f7f7f7;
|
|
|
+ font-size: 16px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ background: #0083ff;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content-r {
|
|
|
+ width: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+:deep(.caret-wrapper) {
|
|
|
+ display: none !important;
|
|
|
}
|
|
|
</style>
|