tangning 8 månader sedan
förälder
incheckning
a0fb296217
2 ändrade filer med 265 tillägg och 75 borttagningar
  1. 86 75
      src/api/dealer/index.ts
  2. 179 0
      src/views/dealer/loglist.vue

+ 86 - 75
src/api/dealer/index.ts

@@ -21,86 +21,97 @@ enum Api {
   checkUserName = '/service/manage/agentNew/checkUserName',
   logList = '/service/manage/agentNew/logList',
   export = '/service/manage/agentNew/export',
-  addIncrementNum = '/service/manage/agentNew/addIncrementNum'
+  addIncrementNum = '/service/manage/agentNew/addIncrementNum',
+  AgentLoglist = '/service/manage/manageAgentLog/list',
 }
 
 /**
  * @description: Get sample list value
  */
 
- export const agentNewList = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.agentNewList,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- export const agentNewAdd = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.agentNewAdd,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- export const agentNewDel = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.agentNewDel,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- export const agentNewUpdate = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.agentNewUpdate,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- export const addIncrementNum = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.addIncrementNum,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- export const checkUser = (params: PageParams) =>
- defHttp.get<Result>({
-   url: Api.checkUserName,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
- 
+export const agentNewList = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.agentNewList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const agentNewAdd = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.agentNewAdd,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const agentNewDel = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.agentNewDel,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const agentNewUpdate = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.agentNewUpdate,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const addIncrementNum = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.addIncrementNum,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const checkUser = (params: PageParams) =>
+  defHttp.get<Result>({
+    url: Api.checkUserName,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
 export const logListApi = (params: PageParams) =>
- defHttp.post<Result>({
-   url: Api.logList,
-   params: params,
-   headers: {
-     // @ts-ignore
-     ignoreCancelToken: true,
-   },
- });
+  defHttp.post<Result>({
+    url: Api.logList,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+export const AgentLoglist = (params: PageParams) =>
+  defHttp.post<Result>({
+    url: Api.AgentLoglist,
+    params: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+  
 export const DownExport = (params: PageParams) =>
-defHttp.downloadFile<FileStream>({
-  url: Api.export,
-  params: params,
-  fileName:'经销商销售统计.xlsx',
-  // data: params,
-  headers: {
-    // @ts-ignore
-    ignoreCancelToken: true,
-  },
-  responseType: 'blob'
-});
+  defHttp.downloadFile<FileStream>({
+    url: Api.export,
+    params: params,
+    fileName: '经销商销售统计.xlsx',
+    // data: params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+    responseType: 'blob',
+  });

+ 179 - 0
src/views/dealer/loglist.vue

@@ -0,0 +1,179 @@
+<template>
+  <PageWrapper contentBackground>
+    <!-- <template #footer>
+      <a-tabs v-model:activeKey="language" @change="changeTable">
+        <a-tab-pane key="cn" tab="Chinese" />
+        <a-tab-pane key="en" tab="English" />
+      </a-tabs>
+    </template> -->
+
+    <div class="desc-wrap-BasicTable">
+      <BasicTable @register="registerTable"></BasicTable>
+    </div>
+  </PageWrapper>
+</template>
+<script lang="ts">
+  import { defineComponent, h, ref, onMounted } from 'vue';
+  import {
+    BasicTable,
+    useTable,
+    TableAction,
+    BasicColumn,
+    TableImg,
+    FormProps,
+  } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { Time } from '/@/components/Time';
+  import { AgentLoglist } from '/@/api/dealer';
+  import { Descriptions, Tabs } from 'ant-design-vue';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { useUserStore } from '/@/store/modules/user';
+  import dayjs from 'dayjs';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      TableAction,
+      PageWrapper,
+      TableImg,
+      [Descriptions.name]: Descriptions,
+      [Descriptions.Item.name]: Descriptions.Item,
+      [Tabs.name]: Tabs,
+      [Tabs.TabPane.name]: Tabs.TabPane,
+    },
+    setup() {
+      const { t } = useI18n();
+      const userStore = useUserStore();
+      const iseur = userStore.isEnv;
+      const { createMessage } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const language = ref<string>('cn'); //未处理,0已处理(默认1)
+      const columns: BasicColumn[] = [
+        {
+          title: '经销商名称',
+          dataIndex: 'agentName',
+          ellipsis: true,
+          width: 250,
+        },
+        {
+          title: '账号',
+          ellipsis: true,
+          dataIndex: 'agentUserName',
+          width: 120,
+        },
+        {
+          title: '授权详情',
+          ellipsis: true,
+          dataIndex: 'majorAddNum',
+          customRender: ({ record }) => {
+            let streur = `专业会员${record.majorAddNum}年、高级会员${record.highAddNum}月、场景下载${record.downAddNum}次`
+            let str = `专业会员${record.majorAddNum}年、场景下载${record.downAddNum}次`
+            return iseur ? streur : str;
+          },
+          width: 250,
+        },
+        {
+          title: '授权累计',
+          ellipsis: true,
+          customRender: ({ record }) => {
+            let streur = `专业会员${record.majorAddNumTotal}年、高级会员${record.highAddNumTotal}月、场景下载${record.downAddNumTotal}次`
+            let str = `专业会员${record.majorAddNumTotal}年、场景下载${record.downAddNumTotal}次`
+            return iseur ? streur : str;
+          },
+          dataIndex: 'majorAddNumTotal',
+          width: 250,
+        },
+        {
+          title: '操作人',
+          ellipsis: true,
+          dataIndex: 'sysNickName',
+          width: 120,
+        },
+        {
+          title: '操作时间',
+          ellipsis: true,
+          dataIndex: 'updateTime',
+          width: 120,
+        },
+      ];
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'agentName',
+            label: '经销商名称',
+            component: 'Input',
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+          {
+            field: 'agentUserName',
+            label: '账户',
+            component: 'Input',
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+          {
+            field: 'sysNickName',
+            label: '操作人',
+            component: 'Input',
+            colProps: {
+              xl: 7,
+              xxl: 7,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: AgentLoglist,
+        title: '经销商授权记录列表',
+        columns: columns,
+        useSearchForm: true,
+        formConfig: searchForm,
+        showTableSetting: true,
+        showIndexColumn: false,
+        searchInfo: { language },
+        rowKey: 'id',
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        beforeFetch: (T) => {
+          if (T.timeList) {
+            T.timeList[0] = dayjs(T.timeList[0]).format('YYYY-MM-DD');
+            T.timeList[1] = dayjs(T.timeList[1]).format('YYYY-MM-DD');
+          }
+          return T;
+        },
+        canResize: true,
+      });
+      async function hendleAddNew() {
+        await DownExport();
+        console.log('新增新闻');
+      }
+      onMounted(() => {
+        console.log('商家欧酷', dayjs().subtract(6, 'month'), dayjs())
+      })
+      return {
+        registerTable,
+        hendleAddNew,
+        reload,
+        language,
+        register,
+        openModal,
+        getCheckPerm,
+      };
+    },
+  });
+</script>