Explorar el Código

Merge branch 'dealer'

tangning hace 2 años
padre
commit
5f06cd158c

+ 1 - 1
.env.production

@@ -23,7 +23,7 @@ VITE_GLOB_API_URL=
 
 # File upload address, optional
 # It can be forwarded by nginx or write the actual address directly
-VITE_GLOB_UPLOAD_URL=/upload
+VITE_GLOB_UPLOAD_URL=/service/manage/common/upload/files
 
 # Interface prefix
 VITE_GLOB_API_URL_PREFIX=

+ 106 - 0
src/api/dealer/index.ts

@@ -0,0 +1,106 @@
+import { defHttp } from '/@/utils/http/axios';
+import {
+  PageParams,
+  operateList,
+  sceneMoveParams,
+  sceneControlParams,
+  RentListGetResultModel,
+  checkDownLoadResult,
+  sceneDownloadResult,
+  ResultDetail,
+  addCameraParams,
+  updateParams,
+} from './model';
+import { Result, FileStream } from '/#/axios';
+
+enum Api {
+  agentNewList = '/service/manage/agentNew/list',
+  agentNewAdd = '/service/manage/agentNew/add',
+  agentNewUpdate = '/service/manage/agentNew/update',
+  agentNewDel = '/service/manage/agentNew/delete',
+  checkUserName = '/service/manage/agentNew/checkUserName',
+  logList = '/service/manage/agentNew/logList',
+  export = '/service/manage/agentNew/export',
+  addIncrementNum = '/service/manage/agentNew/addIncrementNum'
+}
+
+/**
+ * @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 logListApi = (params: PageParams) =>
+ defHttp.post<Result>({
+   url: Api.logList,
+   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'
+});

+ 131 - 0
src/api/dealer/model.ts

@@ -0,0 +1,131 @@
+import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
+/**
+ * @description: Request list interface parameters
+ */
+export type PageParams = BasicPageParams;
+export interface operateList {
+  companyId?: number;
+  sceneName: string;
+  snCode: string;
+  userName: string;
+  type?: number;
+  pageNum?: number;
+  pageSize?: number;
+}
+export interface overallList {
+  searchKey: string;
+  pageNum?: number;
+  pageSize?: number;
+}
+export interface overallDelete {
+  id: string;
+}
+export interface sceneMoveParams {
+  snCode: string;
+  num: string;
+}
+export interface sceneControlParams {
+  num: string;
+}
+export interface ResultDetail{
+  content: string,
+  coverImageUrl: string,
+  createTime: string,
+  createrId: number;
+  display: number;
+  id: number;
+  isPublic: number;
+  isTop: number;
+  newType: number;
+  publicTime: string,
+  source: string,
+  tbStatus: number;
+  title: string,
+  topTime: string,
+  updateTime: string,
+  updaterId: number;
+}
+export interface addCameraParams {
+  address: string;
+  balance: string;
+  cameraType: string;
+  childName: string;
+  companyId?: string;
+  orderSn?: string;
+  own: string;
+  snCode?: string;
+  wifiName: string;
+}
+export interface updateParams {
+  id: number;
+  canShow: number;
+  liveRoomCapacities: number;
+}
+export interface checkDownLoadResult {
+  id: number;
+  canShow: number;
+  downloadStatus: number;
+  percent: number;
+  liveRoomCapacities: number;
+}
+
+export interface sceneDownloadResult {
+  id: number;
+  canShow: number;
+  downloadStatus: number;
+  percent: number;
+  liveRoomCapacities: number;
+}
+export interface DeviceListItem {
+  id: number;
+  activatedTime: string;
+  address: string;
+  agentFrameworkId: string;
+  agentFrameworkName: string;
+  agentName: string;
+  balance: string;
+  cameraType: number;
+  childName: string;
+  companyId: string;
+  companyName: string;
+  cooperationUser: string;
+  cooperationUserName: string;
+  country: number;
+  createTime: string;
+  goodsId: number;
+  goodsName: string;
+  imageUrl: string;
+  inTime: string;
+  isExpire: string;
+  lastTime: string;
+  nickName: string;
+  orderSn: string;
+  outTime: string;
+  own: number;
+  pic: string;
+  recStatus: string;
+  responseUserIncrement: string;
+  sceneNum: string;
+  snCode: string;
+  space: string;
+  spaceContent: string;
+  spaceEndStr: string;
+  spaceEndTime: string;
+  spaceId: string;
+  spaceStr: string;
+  surplusDate: string;
+  totalSpace: number;
+  totalSpaceStr: string;
+  type: string;
+  usedSpace: number;
+  usedSpaceStr: string;
+  userId: string;
+  userIncrementId: string;
+  userName: string;
+  wifiName: string;
+}
+
+/**
+ * @description: Request list return value
+ */
+export type RentListGetResultModel = BasicFetchResult<DeviceListItem>;

+ 41 - 0
src/router/routes/modules/dealer.ts

@@ -0,0 +1,41 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const order: AppRouteModule = {
+  path: '/dealer',
+  name: 'Dealer',
+  component: LAYOUT,
+  redirect: '/dealer/account',
+  meta: {
+    icon: 'bi:columns',
+    title: '经销商管理',
+    orderNo: 102,
+  },
+  children: [
+    {
+      path: 'account',
+      name: 'Account',
+      component: () => import('/@/views/dealer/account.vue'),
+      // component: () => import('/@/views/system/account/index.vue'),
+      meta: {
+        title: '经销商账号管理',
+        icon: 'bx:list-ul',
+        hideChildrenInMenu: true,
+      },
+    },{
+      path: 'finance',
+      name: 'Finance',
+      component: () => import('/@/views/dealer/finance.vue'),
+      // component: () => import('/@/views/system/account/index.vue'),
+      meta: {
+        title: '经销商结算统计',
+        icon: 'bx:list-ul',
+        hideChildrenInMenu: true,
+      },
+    },
+  ],
+};
+
+export default order;

+ 11 - 0
src/router/routes/modules/operate.ts

@@ -47,6 +47,17 @@ const order: AppRouteModule = {
         hideChildrenInMenu: true,
       },
     },
+    {
+      path: 'dealer',
+      name: 'Dealer',
+      component: () => import('/@/views/operate/dealerList.vue'),
+      // component: () => import('/@/views/system/account/index.vue'),
+      meta: {
+        title: t('routes.dashboard.operateMessage'),
+        icon: 'bx:list-ul',
+        hideChildrenInMenu: true,
+      },
+    },
   ],
 };
 

+ 225 - 0
src/views/dealer/account.vue

@@ -0,0 +1,225 @@
+<template>
+  <PageWrapper contentBackground>
+    <div class="desc-wrap-BasicTable">
+      <BasicTable @register="registerTable">
+        <template #toolbar>
+          <a-button type="primary" @click="openModal(true, {language})" v-if="getCheckPerm('news-add')">
+            新增经销商</a-button
+          >
+        </template>
+        <template #action="{ record }">
+          <TableAction
+            stopButtonPropagation
+            :actions="[
+              {
+                label: '权益设置',
+                //icon: 'icon-park-outline:folder-withdrawal-one',
+                ifShow: getCheckPerm('news-withdraw'),
+                onClick: handleWithdraw.bind(null, record),
+              },
+              {
+                label: '编辑',
+                //icon: 'ep:edit',
+                ifShow: getCheckPerm('news-edit'),
+                onClick: handleEdit.bind(null, record),
+              },
+              {
+                label: '删除',
+                //icon: 'ic:outline-delete-outline',
+                ifShow: getCheckPerm('news-delete'),
+                onClick: handleDelete.bind(null, record),
+              },
+            ]"
+          />
+        </template>
+      </BasicTable>
+    </div>
+    <addNewModal @register="register" @update="reload" />
+    <editNewModal @register="registerEdit" @update="reload" />
+    <financeModal @register="registerFinance" @update="reload" />
+  </PageWrapper>
+</template>
+<script lang="ts">
+import { defineComponent, h, ref } from 'vue';
+import {
+  BasicTable,
+  useTable,
+  TableAction,
+  BasicColumn,
+  TableImg,
+  FormProps,
+} from '/@/components/Table';
+import { PageWrapper } from '/@/components/Page';
+import { Time } from '/@/components/Time';
+import { agentNewList, agentNewDel } 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 addNewModal from './components/addModal.vue';
+import editNewModal from './components/editModal.vue';
+import financeModal from './components/financeModal.vue';
+import { usePermissionStore } from '/@/store/modules/permission';
+export default defineComponent({
+  components: {
+    BasicTable,
+    TableAction,
+    PageWrapper,
+    TableImg,
+    addNewModal,
+    editNewModal,
+    financeModal,
+    [Descriptions.name]: Descriptions,
+    [Descriptions.Item.name]: Descriptions.Item,
+    [Tabs.name]: Tabs,
+    [Tabs.TabPane.name]: Tabs.TabPane,
+  },
+  setup() {
+    const { t } = useI18n();
+    const { createMessage, createConfirm } = useMessage();
+    const permissionStore = usePermissionStore();
+    const { getCheckPerm } = permissionStore;
+    const [register, { openModal }] = useModal();
+    const [registerEdit, { openModal:openEditModal }] = useModal();
+    const [registerFinance, { openModal:openFinanceModal }] = useModal();
+    const language = ref<string>('cn'); //未处理,0已处理(默认1)
+    const columns: BasicColumn[] = [
+      {
+        title: '经销商名称',
+        dataIndex: 'name',
+        ellipsis: true,
+        width: 250,
+      },
+      {
+        title: '联系人',
+        dataIndex: 'nickName',
+        ellipsis: true,
+        width: 250,
+      },
+      {
+        title: '账号',
+        ellipsis: true,
+        dataIndex: 'userName',
+        width: 120,
+      },
+      {
+        title: '创建人',
+        ellipsis: true,
+        dataIndex: 'sysUserName',
+        width: 120,
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createTime',
+        width: 150,
+        customRender: ({ record }) => {
+          return (
+            record.createTime &&
+            h(Time, {
+              value: record.createTime,
+              mode: 'datetime',
+            })
+          );
+        },
+      },
+    ];
+    const searchForm: Partial<FormProps> = {
+      labelWidth: 100,
+      autoSubmitOnEnter: true,
+      schemas: [
+        {
+          field: 'name',
+          label: '经销商名称',
+          component: 'Input',
+          colProps: {
+            xl: 7,
+            xxl: 7,
+          },
+        },
+      ],
+    };
+    const [registerTable, { reload }] = useTable({
+      api: agentNewList,
+      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.ctivated) {
+          T.publicTimeStart = T.ctivated[0];
+          T.publicTimeEnd = T.ctivated[1];
+        }
+        return T;
+      },
+      actionColumn: {
+        width: 220,
+        title: '操作',
+        dataIndex: 'action',
+        slots: { customRender: 'action' },
+      },
+      canResize: true,
+    });
+    async function handleDelete(record: Recordable) {
+      createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定要删除吗?'),
+          onOk: async () => {
+            await agentNewDel({ id: record.id });
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+    }
+    async function handlePublish(record: Recordable) {
+      console.log('点击了发布', record);
+      await casePublicApi({ id: record.id, isPublic: 1 });
+      createMessage.success(t('common.optSuccess'));
+      reload();
+    }
+    function handleEdit(record: Recordable) {
+      console.log('点击了编辑', record);
+      openEditModal(true, {...record,language});
+    }
+    async function handleWithdraw(record: Recordable) {
+      openFinanceModal(true, {...record});
+      // await casePublicApi({ id: record.id, isPublic: 0 });
+      // createMessage.success(t('common.optSuccess'));
+      // reload();
+    }
+    function changeTable(val: string) {
+        language.value = val;
+        reload();
+      }
+    function hendleAddNew() {
+      console.log('新增新闻');
+    }
+    return {
+      registerTable,
+      handleDelete,
+      handleEdit,
+      handleWithdraw,
+      handlePublish,
+      hendleAddNew,
+      changeTable,
+      reload,
+      language,
+      register,
+      registerFinance,
+      registerEdit,
+      openModal,
+      getCheckPerm,
+    };
+  },
+});
+</script>

+ 163 - 0
src/views/dealer/components/addModal.vue

@@ -0,0 +1,163 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="title"
+    :width="600"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleSubmit"
+  >
+    <div class="pt-2px pr-3px">
+      <BasicForm @register="registerForm" >
+        <template #text="{ model, field }">
+          {{ model[field]  }}
+        </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, nextTick, onMounted, reactive } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { agentNewAdd, checkUser } from '/@/api/dealer'
+  import { useI18n } from '/@/hooks/web/useI18n';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const modelRef = ref({});
+      const title = ref('新增经销商');
+      const preventAutoFill = ref(true);
+      const fileFlow = reactive({
+        coverImageUrl:''
+      })
+      const { createMessage } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'name',
+          component: 'Input',
+          label: '经销商名称',
+          required: true,
+          componentProps: {
+            maxlength: 50,
+          },
+          colProps: {
+            span: 22,
+          },
+        },{
+            field: 'nickName',
+            component: 'Input',
+            required: false,
+            label: '联系人',
+            componentProps: {
+              maxlength: 50,
+            },
+            colProps: {
+              span: 22,
+            },
+        },{
+            field: 'userName',
+            component: 'Input',
+            label: '账号',
+            required: true,
+            componentProps: {
+              placeholder:"请输入四维看看账号",
+              autoComplete:'off',
+              // readonly:preventAutoFill.value
+            },
+            rules: [
+              {
+                required: true,
+                // @ts-ignore
+                validator: async (rule, value) => {
+                  console.log('value',value)
+                  const regPos = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/; // 非中文
+                  if (!value) {
+                    return Promise.reject('请输入四维看看账号');
+                  }
+                  if (!regPos.test(value)) {
+                    /* eslint-disable-next-line */
+                    return Promise.reject('请输入正确的手机号');
+                  }
+                  let res = await checkUser({userName:value})
+                  if(!res){
+                    return Promise.reject('用户不存在');
+                  }
+                  return Promise.resolve();
+                },
+                trigger: 'change',
+              },
+            ],
+            colProps: {
+              span: 22,
+            },
+        },
+      ];
+      const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      const formatrichtext = (richtext, len = 0) => {
+          let content = richtext.replace(/<.+?>/g, '');    
+          content = content.replace(/ /ig, ''); /* 去除  */    
+          content = content.replace(/\s/ig, ''); /* 去除空格 */
+          return content && content.length;
+      }
+      async function onDataReceive(data) {
+        modelRef.value = data
+        resetFields();
+      }
+      const handleSubmit = async () => {
+        const params = await validate();
+        const apiData = {
+          ...params as any,
+          coverImageUrl:params.coverImageUrl && params.coverImageUrl[0],
+          content:params.newType == 1?params.newsUrl:params.content
+        }
+        try {
+          await agentNewAdd(apiData);
+          closeModal();
+          resetFields();
+          createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        schemas,
+        registerForm,
+        model: modelRef,
+        fileFlow,
+        preventAutoFill,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        title,
+        t,
+      };
+    },
+  });
+</script>

+ 135 - 0
src/views/dealer/components/editModal.vue

@@ -0,0 +1,135 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="title"
+    :width="600"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleSubmit"
+  >
+    <div class="pt-2px pr-3px">
+      <BasicForm @register="registerForm" >
+        <template #text="{ model, field }">
+          {{ model[field]  }}
+        </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, nextTick, onMounted, reactive, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { agentNewUpdate } from '/@/api/dealer'
+  import { useI18n } from '/@/hooks/web/useI18n';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const modelRef = ref({});
+      const title = ref('编辑经销商');
+      const preventAutoFill = ref(true);
+      const fileFlow = reactive({
+        coverImageUrl:''
+      })
+      const { createMessage } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show:false,
+          label: 'id',
+          required: false,
+        },{
+          field: 'name',
+          component: 'Input',
+          label: '经销商名称',
+          required: true,
+          componentProps: {
+            maxlength: 50,
+          },
+          colProps: {
+            span: 22,
+          },
+        },{
+            field: 'nickName',
+            component: 'Input',
+            required: false,
+            label: '联系人',
+            componentProps: {
+              maxlength: 50,
+            },
+            colProps: {
+              span: 22,
+            },
+        },
+      ];
+      const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
+        labelWidth: 120,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      const formatrichtext = (richtext, len = 0) => {
+          let content = richtext.replace(/<.+?>/g, '');    
+          content = content.replace(/ /ig, ''); /* 去除  */    
+          content = content.replace(/\s/ig, ''); /* 去除空格 */
+          return content && content.length;
+      }
+      async function onDataReceive(data) {
+        modelRef.value = data
+        setFieldsValue({
+          id:data.id,
+          name:data.name,
+          nickName:data.nickName,
+        });
+      }
+      const handleSubmit = async () => {
+        const params = await validate();
+        const apiData = {
+          ...params as any,
+        }
+        try {
+          await agentNewUpdate(apiData);
+          closeModal();
+          resetFields();
+          createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        schemas,
+        registerForm,
+        model: modelRef,
+        fileFlow,
+        preventAutoFill,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        title,
+        t,
+      };
+    },
+  });
+</script>

+ 161 - 0
src/views/dealer/components/financeModal.vue

@@ -0,0 +1,161 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="title"
+    :width="600"
+    @visible-change="handleVisibleChange"
+    @cancel="resetFields"
+    @ok="handleSubmit"
+  >
+    <div class="pt-2px pr-3px">
+      <BasicForm @register="registerForm" >
+        <template #text="{ model, field }">
+          {{ model[field]  }}
+        </template>
+      </BasicForm>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, nextTick, onMounted, reactive, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { addIncrementNum } from '/@/api/dealer'
+  import { useI18n } from '/@/hooks/web/useI18n';
+
+  const { t } = useI18n();
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['update', 'register'],
+    setup(props, { emit }) {
+      const modelRef = ref({});
+      const title = ref('编辑经销商');
+      const preventAutoFill = ref(true);
+      const fileFlow = reactive({
+        coverImageUrl:''
+      })
+      const { createMessage } = useMessage();
+      const schemas: FormSchema[] = [
+        {
+          field: 'id',
+          component: 'Input',
+          show:false,
+          label: 'id',
+          required: false,
+        },{
+          field: 'majorAddNum',
+          component: 'InputNumber',
+          label: '专业会员(年)剩余可售 0 个 新增',
+          defaultValue: 0,
+          componentProps: {
+            maxlength: 50,
+            min:0,
+          },
+          colProps: {
+            span: 22,
+          },
+        },{
+          field: 'highAddNum',
+          component: 'InputNumber',
+          label: '高级会员(年)剩余可售 0 个 新增',
+          defaultValue: 0,
+          ifShow:false,
+          componentProps: {
+            maxlength: 50,
+            min:0,
+          },
+          colProps: {
+            span: 22,
+          },
+        },{
+          field: 'downAddNum',
+          component: 'InputNumber',
+          label: '场景下载剩余可售 0 次 新增',
+          defaultValue: 0,
+          componentProps: {
+            maxlength: 50,
+            min:0,
+          },
+          colProps: {
+            span: 22,
+          },
+        }
+      ];
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
+        labelWidth: 250,
+        schemas,
+        showActionButtonGroup: false,
+        actionColOptions: {
+          span: 24,
+        },
+      });
+      onMounted(() => {});
+      let addListFunc = () => {};
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+      async function onDataReceive(data) {
+        modelRef.value = data
+        console.log('downSubNum',data)
+        resetFields()
+        setFieldsValue({
+          id:data.id,
+        })
+        setTimeout(()=>{
+          updateSchema([{
+            field: 'majorAddNum',
+            label: `专业会员(年)剩余可售 ${data.majorSubNum || 0} 个 新增`,
+          },{
+            field: 'highAddNum',
+            label: `高级会员(年)剩余可售 ${data.highSubNum || 0} 个 新增`,
+            ifShow: data.highSubNum>0,
+          },{
+            field: 'downAddNum',
+            label: `场景下载剩余可售 ${data.downSubNum || 0} 次 新增`,
+          }])
+        },500)
+      }
+      const handleSubmit = async () => {
+        const params = await validate();
+        console.log('次',params)
+        const apiData = {
+          id:params.id,
+          majorAddNum:params.majorAddNum || 0,
+          highAddNum:params.highAddNum || 0,
+          downAddNum:params.downAddNum || 0,
+        }
+        try {
+          await addIncrementNum(apiData);
+          closeModal();
+          resetFields();
+          createMessage.success(t('common.optSuccess'));
+          emit('update');
+        } catch (error) {
+          console.log('not passing', error);
+        }
+      };
+      function handleVisibleChange(v) {
+        v && props.userData && nextTick(() => onDataReceive(props.userData));
+      }
+      return {
+        register,
+        schemas,
+        registerForm,
+        model: modelRef,
+        fileFlow,
+        preventAutoFill,
+        handleVisibleChange,
+        handleSubmit,
+        addListFunc,
+        resetFields,
+        title,
+        t,
+      };
+    },
+  });
+</script>

+ 144 - 0
src/views/dealer/finance.vue

@@ -0,0 +1,144 @@
+<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">
+        <template #toolbar>
+          <a-button type="primary" @click="hendleAddNew" v-if="getCheckPerm('news-add')">
+            导出excel</a-button
+          >
+        </template>
+      </BasicTable>
+    </div>
+  </PageWrapper>
+</template>
+<script lang="ts">
+import { defineComponent, h, ref } from 'vue';
+import {
+  BasicTable,
+  useTable,
+  TableAction,
+  BasicColumn,
+  TableImg,
+  FormProps,
+} from '/@/components/Table';
+import { PageWrapper } from '/@/components/Page';
+import { Time } from '/@/components/Time';
+import { logListApi, DownExport } 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';
+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 { 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: '专业会员(年)销售数量',
+        dataIndex: 'majorNum',
+        ellipsis: true,
+        width: 80,
+      },
+      {
+        title: '高级会员(月)销售数量',
+        ellipsis: true,
+        dataIndex: 'highNum',
+        width: 120,
+      },
+      {
+        title: '场景下载销售数量',
+        ellipsis: true,
+        dataIndex: 'downNum',
+        width: 120,
+      },
+    ];
+    const searchForm: Partial<FormProps> = {
+      labelWidth: 100,
+      autoSubmitOnEnter: true,
+      schemas: [
+        {
+          field: 'timeList',
+          label: '时间段',
+          component: 'RangePicker',
+          componentProps: {
+            maxLength: 100,
+            format: 'YYYY-MM-DD',
+            valueFormat: 'YYYY-MM-DD',
+            showTime: true,
+          },
+          colProps: {
+            xl: 8,
+            xxl: 8,
+          },
+        },
+      ],
+    };
+    const [registerTable, { reload }] = useTable({
+      api: logListApi,
+      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.ctivated) {
+          T.publicTimeStart = T.ctivated[0];
+          T.publicTimeEnd = T.ctivated[1];
+        }
+        return T;
+      },
+      canResize: true,
+    });
+    async function hendleAddNew() {
+      await DownExport()
+      console.log('新增新闻');
+    }
+    return {
+      registerTable,
+      hendleAddNew,
+      reload,
+      language,
+      register,
+      openModal,
+      getCheckPerm,
+    };
+  },
+});
+</script>

+ 0 - 0
src/views/operate/dealerList.vue