Parcourir la source

feat:应收汇总(项目经理)、万宇应收(业务公司)

snow il y a 1 an
Parent
commit
6519f95613
24 fichiers modifiés avec 907 ajouts et 9 suppressions
  1. 2 2
      src/views/time/_http/createRequset.ts
  2. 1 1
      src/views/time/customerDepartment/components/detail.vue
  3. 1 1
      src/views/time/mediumDepartment/components/detail.vue
  4. 1 1
      src/views/time/projectDepartment/components/detail.vue
  5. 3 1
      src/views/time/receivable/components/all.vue
  6. 3 1
      src/views/time/receivable/components/business.vue
  7. 0 0
      src/views/time/receivable/应收汇总-创建人
  8. 4 1
      src/views/time/receivableDetail/components/all.vue
  9. 1 1
      src/views/time/receivableDetail/components/business.vue
  10. 5 0
      src/views/time/receivableDetail/components/config/content.config.ts
  11. 107 0
      src/views/time/receivableMain/components/all.vue
  12. 128 0
      src/views/time/receivableMain/components/business.vue
  13. 8 0
      src/views/time/receivableMain/components/config/apis.ts
  14. 104 0
      src/views/time/receivableMain/components/config/content.config.ts
  15. 44 0
      src/views/time/receivableMain/components/config/search.config.ts
  16. 49 0
      src/views/time/receivableMain/index.vue
  17. 0 0
      src/views/time/receivableMain/应收汇总-项目经理
  18. 107 0
      src/views/time/receivableWanyu/components/all.vue
  19. 128 0
      src/views/time/receivableWanyu/components/business.vue
  20. 8 0
      src/views/time/receivableWanyu/config/apis.ts
  21. 85 0
      src/views/time/receivableWanyu/config/content.config.ts
  22. 31 0
      src/views/time/receivableWanyu/config/search.config.ts
  23. 87 0
      src/views/time/receivableWanyu/index.vue
  24. 0 0
      src/views/time/receivableWanyu/万宇应收-业务公司

+ 2 - 2
src/views/time/_http/createRequset.ts

@@ -5,9 +5,9 @@ import { httpExport } from "/@/api/export";
 const { VITE_PROXY_DOMAIN_REAL } = loadEnv();
 const yewuApi = VITE_PROXY_DOMAIN_REAL + "/";
 
-export function createHttpRequest(path: string) {
+export function createHttpRequest(path: string, url: string = "") {
   return (data: object): Promise<any> => {
-    return http.request("post", `${yewuApi}${path}`, {
+    return http.request("post", `${url ? url : yewuApi}${path}`, {
       data
     });
   };

+ 1 - 1
src/views/time/customerDepartment/components/detail.vue

@@ -47,7 +47,7 @@ async function handleExportAllReport() {
     await httpRequsetExport({
       fileType: "application/vnd.ms-excel;charset=utf-8",
       name: "客户部提成业绩明细.xlsx",
-      url: "report/exportinfo",
+      url: "/admin/report/exportinfo",
       ...callback,
       params
     });

+ 1 - 1
src/views/time/mediumDepartment/components/detail.vue

@@ -47,7 +47,7 @@ async function handleExportAllReport() {
   try {
     await httpRequsetExport({
       fileType: "application/vnd.ms-excel;charset=utf-8",
-      url: "report/exportinfo",
+      url: "/admin/report/exportinfo",
       name: "新媒体提成业绩明细.xlsx",
       ...callback,
       params

+ 1 - 1
src/views/time/projectDepartment/components/detail.vue

@@ -47,7 +47,7 @@ async function handleExportAllReport() {
   try {
     await httpRequsetExport({
       fileType: "application/vnd.ms-excel;charset=utf-8",
-      url: "report/exportinfo",
+      url: "/admin/report/exportinfo",
       name: "项目部新政策提成业绩明细.xlsx",
       ...callback,
       params

+ 3 - 1
src/views/time/receivable/components/all.vue

@@ -29,7 +29,8 @@ const hooks: PageHooks = {
       result: {
         start: start + " 00:00:00",
         end: end + " 23:59:59",
-        plat_type:"1",
+        plat_type: "1",
+        dz_type:"1",
         ...rest
       },
       deleteProps:['date']
@@ -46,6 +47,7 @@ const hooks: PageHooks = {
         start: start + " 00:00:00",
         end: end + " 23:59:59",
         plat_type: "1",
+         dz_type:"1",
         depart_id,
       },
       deleteProps:['date']

+ 3 - 1
src/views/time/receivable/components/business.vue

@@ -45,7 +45,8 @@ const hooks: PageHooks = {
       result: {
         start: start + " 00:00:00",
         end: end + " 23:59:59",
-        plat_type:"1",
+        plat_type: "1",
+         dz_type:"1",
         ...rest
       },
       deleteProps:['date']
@@ -63,6 +64,7 @@ const hooks: PageHooks = {
         end: end + " 23:59:59",
         companyNo,
         plat_type: "1",
+        dz_type:"1",
         depart_id
       },
       deleteProps:['date']

+ 0 - 0
src/views/time/receivable/应收账款汇总 → src/views/time/receivable/应收汇总-创建人


+ 4 - 1
src/views/time/receivableDetail/components/all.vue

@@ -82,11 +82,14 @@ async function handleExportAllReport() {
   const { start, end } = params;
 
   const beyondTime = isBeyondTime({ start, end, len: 30 });
+
+  console.log(params)
+
   if (beyondTime) return;
   await httpRequsetExport({
     fileType: "aplication/x-msexecl",
     name: "应收账款明细.xlsx",
-    url: "report/dzListExport",
+    url: "/admin/report/dzListExport",
     ...callback,
     params
   });

+ 1 - 1
src/views/time/receivableDetail/components/business.vue

@@ -110,7 +110,7 @@ async function handleExportAllReport() {
   await httpRequsetExport({
     fileType: "aplication/x-msexecl",
     name: "应收账款明细.xlsx",
-    url: "report/dzListExport",
+    url: "/admin/report/dzListExport",
     ...callback,
     params
   });

+ 5 - 0
src/views/time/receivableDetail/components/config/content.config.ts

@@ -63,6 +63,11 @@ const columns = [
     label: '业务员',
     width: '90px',
   },
+  {
+    prop: 'manager',
+    label: '项目经理',
+    width: '90px',
+  },
   {
     prop: 'goodName',
     label: '产品名称',

+ 107 - 0
src/views/time/receivableMain/components/all.vue

@@ -0,0 +1,107 @@
+<script setup lang="ts">
+import { ref , watch} from "vue";
+import searchConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+
+import { PageContentInstance } from "/@/components/PageContent";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { isBeyondTime } from "/@/views/time/_utils";
+import { frontEndExport } from "/@/utils/export";
+import { usePermission } from "/@/hooks/core";
+import { useUserStore } from "/@/store/modules/user";
+import dayjs from "dayjs"
+
+const pageName = "receivableMain";
+const { hasPermissionWithCode } = usePermission(pageName);
+const pageContentRef = ref<PageContentInstance | null>(null);
+const userStore = useUserStore();
+
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch((params) => { 
+    const { date, ...rest } = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type:"2",
+        ...rest
+      },
+      deleteProps:['date']
+    }
+  },
+   (params) => { 
+    const { date , depart_id} = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type: "2",
+        depart_id,
+      },
+      deleteProps:['date']
+    }
+  }, searchConfig)
+};
+
+
+const searchConfigRef = ref(searchConfig);
+watch(
+  () => userStore.level,
+  level => {
+    const { formItems } = searchConfigRef.value;
+    const index = formItems.findIndex(({ field }) => field === "depart_id");
+    const { itemid = "" } = userStore.info || {};
+
+    if (Number(level) === 2) {
+      searchConfigRef.value.formItems[index].disabled = Number(level) === 2;
+      searchConfigRef.value.formItems[index].defaultValue = itemid;
+    }
+  },
+  {
+    immediate: true
+  }
+);
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+  const { start, end } = params;
+  const beyondTime = isBeyondTime({ start, end, len: 30 });
+  if (beyondTime) return;
+  const data = pageContentRef.value.getData();
+  frontEndExport({ columns: contentConfig.columns, name: "应收账款汇总.xlsx", data });
+}
+</script>
+
+<template>
+  <page-auth :page-name="pageName">
+    <page-container
+      :hooks="hooks"
+      :page-name="pageName"
+      :get-content-ref="ref => (pageContentRef = ref)"
+      :content-config="contentConfig"
+      :search-config="searchConfigRef"
+    >
+      <template #content_header>
+        <el-button
+          v-if="hasPermissionWithCode('9')"
+          @click="handleExportAllReport"
+          size="small"
+          :icon="useRenderIcon('arrow-up-line')"
+          type="primary"
+          >导出</el-button>
+      </template>
+    </page-container>
+  </page-auth>
+</template>

+ 128 - 0
src/views/time/receivableMain/components/business.vue

@@ -0,0 +1,128 @@
+<script setup lang="ts">
+import { ref, watch } from "vue";
+import apis from "./config/apis";
+import { ElMessage } from "element-plus";
+import { usePermission } from "/@/hooks/core";
+import { frontEndExport } from "/@/utils/export";
+import { isBeyondTime } from "/@/views/time/_utils";
+import sourceSearchConfig from "./config/search.config";
+import sourceContentConfig from "./config/content.config";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { PageContentInstance } from "/@/components/PageContent";
+import { useBusinessSearch, useBusinessContent } from "./../../_hooks";
+import { useUserStore } from "/@/store/modules/user";
+import dayjs from "dayjs"
+
+const pageContentRef = ref<PageContentInstance | null>(null);
+const lockKey = "companyNo";
+
+const pageName = "receivableMain";
+const { hasPermissionWithCode } = usePermission(pageName);
+
+const userStore = useUserStore();
+const { searchConfig } = useBusinessSearch({
+  sourceConfig: sourceSearchConfig,
+  queryField: "companyNo"
+});
+
+const searchConfigRef = ref(searchConfig);
+
+const { contentConfig } = useBusinessContent({
+  sourceConfig: sourceContentConfig,
+  apis: { httpList: apis.list }
+});
+
+const hooks: PageHooks = {
+  pageSearchHook: () =>
+    usePageSearch((params) => { 
+    const { date, ...rest } = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type: "2",
+        ...rest
+      },
+      deleteProps:['date']
+    }
+  },
+   (params) => { 
+     const { date, companyNo,depart_id } = params;
+     const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        companyNo,
+        plat_type: "1",
+        dz_type: "2",
+        depart_id
+      },
+      deleteProps:['date']
+    }
+  }, searchConfig, false, lockKey)
+};
+
+watch(
+  () => userStore.level,
+  level => {
+    const { formItems } = searchConfigRef.value;
+    const index = formItems.findIndex(({ field }) => field === "depart_id");
+    const { itemid = "" } = userStore.info || {};
+
+    if (Number(level) === 2) {
+      searchConfigRef.value.formItems[index].disabled = Number(level) === 2;
+      searchConfigRef.value.formItems[index].defaultValue = itemid;
+    }
+  },
+  {
+    immediate: true
+  }
+);
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+
+  const { start, end } = params;
+
+  if (!params[lockKey]) {
+    ElMessage.warning("请选择业务公司");
+    return;
+  }
+
+  const beyondTime = isBeyondTime({ end,  start, len: 30 });
+  if (beyondTime) return;
+  const data = pageContentRef.value.getData();
+  frontEndExport({ columns: contentConfig.columns, name: "应收账款汇总.xlsx", data });
+}
+</script>
+
+<template>
+  <PageContainer
+    :hooks="hooks"
+    :getContentRef="ref => (pageContentRef = ref)"
+    :content-config="contentConfig"
+    :search-config="searchConfig"
+    lockKey="companyNo"
+  >
+    <template #content_header>
+      <el-button
+        v-if="hasPermissionWithCode('18')"
+        :icon="useRenderIcon('arrow-up-line')"
+        @click="handleExportAllReport"
+        size="small"
+        type="primary"
+        >导出</el-button
+      >
+    </template>
+  </PageContainer>
+</template>

+ 8 - 0
src/views/time/receivableMain/components/config/apis.ts

@@ -0,0 +1,8 @@
+import { createHttpRequest } from "/@/views/time/_http";
+
+const baseUrl = "admin/report/";
+
+
+export default {
+  list: createHttpRequest(`${baseUrl}dzListByUser`),
+};

+ 104 - 0
src/views/time/receivableMain/components/config/content.config.ts

@@ -0,0 +1,104 @@
+/* eslint-disable prettier/prettier */
+import { BeforeRequestType, ContentConfig } from "/@/components/PageContent";
+import apis from "./apis";
+import { isBeyondTime } from "/@/views/reportCollection/_utils";
+import { addition } from "/@/utils/calc";
+import { ElMessage } from "element-plus";
+
+const columns = [
+  {
+    prop: 'manager',
+    label: '项目经理',
+    minWidth: '155px'
+  },
+  {
+    prop: 'department',
+    label: '所在部门',
+    minWidth: '155px'
+  },
+  {
+    prop: 'wpay_fee',
+    label: '未回款总额',
+    minWidth: '155px'
+  },
+
+  {
+    prop: 'pay_fee',
+    label: '回款进行中总额',
+    minWidth: '155px'
+  },
+  {
+    prop: 'apay_fee',
+    label: '已回款总额',
+    minWidth: '155px'
+  },
+  {
+    prop: 'winv_fee',
+    label: '未开票总额',
+    minWidth: '155px'
+  },
+  {
+    prop: 'inv_fee',
+    label: '开票进行中总额',
+    minWidth: '155px'
+  },
+  {
+    prop: 'ainv_fee',
+    label: '已开票总额',
+    minWidth: '155px'
+  }
+];
+
+const contentConfig: ContentConfig = {
+  columns,
+  title: "仅统计toB订单",
+  responseCode: 0,
+  notPagination: true,
+  superUserNoAction: false,
+  tableRowClassName({ rowIndex }) {
+    if (rowIndex === 0) {
+      return "warning-row"
+    }
+  },
+  beforeRequestList(params) {
+    const { start, end } = params;
+    if (start && end) return BeforeRequestType.NEXT;
+    ElMessage.warning("请选择下单月份");
+    return BeforeRequestType.EMPTY
+  },
+  handleData(list) {
+    const mapTotal: Record<string, string | number> = {
+      ownerName: '合计',
+      department: '--',
+      wpay_fee: 0,
+      pay_fee: 0,
+      apay_fee: 0,
+      winv_fee: 0,
+      inv_fee: 0,
+      ainv_fee: 0,
+    }
+
+    list.forEach(item => {
+      const {
+        wpay_fee,
+        pay_fee,
+        apay_fee,
+        winv_fee,
+        inv_fee,
+        ainv_fee
+      } = item;
+
+      mapTotal.wpay_fee = Number(addition(mapTotal.wpay_fee, wpay_fee)).toFixed(0);
+      mapTotal.pay_fee = Number(addition(mapTotal.pay_fee, pay_fee)).toFixed(2);
+      mapTotal.apay_fee = Number(addition(mapTotal.apay_fee, apay_fee)).toFixed(2);
+      mapTotal.winv_fee = Number(addition(mapTotal.winv_fee, winv_fee)).toFixed(2);
+      mapTotal.inv_fee = Number(addition(mapTotal.inv_fee, inv_fee)).toFixed(2);
+      mapTotal.ainv_fee = Number(addition(mapTotal.ainv_fee, ainv_fee)).toFixed(2);
+    });
+
+    return [mapTotal, ...list]
+  },
+  apis: { httpList: apis.list }
+};
+
+export default contentConfig;

+ 44 - 0
src/views/time/receivableMain/components/config/search.config.ts

@@ -0,0 +1,44 @@
+import { FormConfig } from "/@/components/PageSearch";
+import dayjs from "dayjs";
+import { useUserStore } from "/@/store/modules/user";
+
+const current = dayjs(new Date()).format("YYYY-MM");
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "date",
+      type: "date_picker",
+      trigger: "change",
+      defaultValue: current,
+      label: '下单月份:',
+      otherOptions: {
+        type: "month",
+        valueFormat: "YYYY-MM",
+        format: "YYYY-MM",
+        clearable: false,
+        // prefix: "下单月份:"
+      }
+    },
+    {
+      field: "depart_id",
+      type: "depart-query",
+      trigger: "change"
+    },
+    // {
+    //   field: 'plat_type',
+    //   type: 'select',
+    //   trigger: 'change',
+    //   defaultValue: '1',
+    //   options: [
+    //     { value: '1', label: 'toB' },
+    //     { value: '2', label: 'toC' }
+    //   ],
+    //   otherOptions: {
+    //     clearable: false
+    //   }
+    // }
+  ]
+};
+
+export default searchFormConfig;

+ 49 - 0
src/views/time/receivableMain/index.vue

@@ -0,0 +1,49 @@
+<script setup lang="ts">
+import { shallowRef, onMounted } from "vue";
+import All from "./components/all.vue";
+import Business from "./components/business.vue";
+import { usePermission } from "/@/hooks/core";
+import NoAuth from "/@/components/NoAuth/NoAuth.vue";
+
+const actived = shallowRef("");
+
+const { hasPermissionWithCode } = usePermission("receivableMain");
+
+onMounted(() => {
+  if (hasPermissionWithCode("3")) {
+    actived.value = "3";
+  } else if (hasPermissionWithCode("11")) {
+    actived.value = "11";
+  }
+});
+</script>
+
+<template>
+  <div class="report-container">
+    <el-tabs v-model="actived" style="color: #fff" v-if="actived">
+      <el-tab-pane label="查看全部" name="3" v-if="hasPermissionWithCode('3')">
+        <all v-if="actived === '3'" />
+      </el-tab-pane>
+
+      <el-tab-pane
+        name="11"
+        label="查看业务公司"
+        v-if="hasPermissionWithCode('11')"
+      >
+        <business v-if="actived === '11'" />
+      </el-tab-pane>
+    </el-tabs>
+
+    <no-auth v-else />
+  </div>
+</template>
+
+<style scoped lang="scss">
+.report-container {
+  height: calc(100vh - 48px);
+  :deep(.el-tabs__header) {
+    background-color: #fff;
+    padding: 10px 10px 0;
+  }
+}
+</style>

+ 0 - 0
src/views/time/receivableMain/应收汇总-项目经理


+ 107 - 0
src/views/time/receivableWanyu/components/all.vue

@@ -0,0 +1,107 @@
+<script setup lang="ts">
+import { ref , watch} from "vue";
+import searchConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+
+import { PageContentInstance } from "/@/components/PageContent";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { isBeyondTime } from "/@/views/time/_utils";
+import { frontEndExport } from "/@/utils/export";
+import { usePermission } from "/@/hooks/core";
+import { useUserStore } from "/@/store/modules/user";
+import dayjs from "dayjs"
+
+const pageName = "receivableMain";
+const { hasPermissionWithCode } = usePermission(pageName);
+const pageContentRef = ref<PageContentInstance | null>(null);
+const userStore = useUserStore();
+
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch((params) => { 
+    const { date, ...rest } = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type:"2",
+        ...rest
+      },
+      deleteProps:['date']
+    }
+  },
+   (params) => { 
+    const { date , depart_id} = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type: "2",
+        depart_id,
+      },
+      deleteProps:['date']
+    }
+  }, searchConfig)
+};
+
+
+const searchConfigRef = ref(searchConfig);
+watch(
+  () => userStore.level,
+  level => {
+    const { formItems } = searchConfigRef.value;
+    const index = formItems.findIndex(({ field }) => field === "depart_id");
+    const { itemid = "" } = userStore.info || {};
+
+    if (Number(level) === 2) {
+      searchConfigRef.value.formItems[index].disabled = Number(level) === 2;
+      searchConfigRef.value.formItems[index].defaultValue = itemid;
+    }
+  },
+  {
+    immediate: true
+  }
+);
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+  const { start, end } = params;
+  const beyondTime = isBeyondTime({ start, end, len: 30 });
+  if (beyondTime) return;
+  const data = pageContentRef.value.getData();
+  frontEndExport({ columns: contentConfig.columns, name: "应收账款汇总.xlsx", data });
+}
+</script>
+
+<template>
+  <page-auth :page-name="pageName">
+    <page-container
+      :hooks="hooks"
+      :page-name="pageName"
+      :get-content-ref="ref => (pageContentRef = ref)"
+      :content-config="contentConfig"
+      :search-config="searchConfigRef"
+    >
+      <template #content_header>
+        <el-button
+          v-if="hasPermissionWithCode('9')"
+          @click="handleExportAllReport"
+          size="small"
+          :icon="useRenderIcon('arrow-up-line')"
+          type="primary"
+          >导出</el-button>
+      </template>
+    </page-container>
+  </page-auth>
+</template>

+ 128 - 0
src/views/time/receivableWanyu/components/business.vue

@@ -0,0 +1,128 @@
+<script setup lang="ts">
+import { ref, watch } from "vue";
+import apis from "./config/apis";
+import { ElMessage } from "element-plus";
+import { usePermission } from "/@/hooks/core";
+import { frontEndExport } from "/@/utils/export";
+import { isBeyondTime } from "/@/views/time/_utils";
+import sourceSearchConfig from "./config/search.config";
+import sourceContentConfig from "./config/content.config";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { PageContentInstance } from "/@/components/PageContent";
+import { useBusinessSearch, useBusinessContent } from "./../../_hooks";
+import { useUserStore } from "/@/store/modules/user";
+import dayjs from "dayjs"
+
+const pageContentRef = ref<PageContentInstance | null>(null);
+const lockKey = "companyNo";
+
+const pageName = "receivableMain";
+const { hasPermissionWithCode } = usePermission(pageName);
+
+const userStore = useUserStore();
+const { searchConfig } = useBusinessSearch({
+  sourceConfig: sourceSearchConfig,
+  queryField: "companyNo"
+});
+
+const searchConfigRef = ref(searchConfig);
+
+const { contentConfig } = useBusinessContent({
+  sourceConfig: sourceContentConfig,
+  apis: { httpList: apis.list }
+});
+
+const hooks: PageHooks = {
+  pageSearchHook: () =>
+    usePageSearch((params) => { 
+    const { date, ...rest } = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type: "2",
+        ...rest
+      },
+      deleteProps:['date']
+    }
+  },
+   (params) => { 
+     const { date, companyNo,depart_id } = params;
+     const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        companyNo,
+        plat_type: "1",
+        dz_type: "2",
+        depart_id
+      },
+      deleteProps:['date']
+    }
+  }, searchConfig, false, lockKey)
+};
+
+watch(
+  () => userStore.level,
+  level => {
+    const { formItems } = searchConfigRef.value;
+    const index = formItems.findIndex(({ field }) => field === "depart_id");
+    const { itemid = "" } = userStore.info || {};
+
+    if (Number(level) === 2) {
+      searchConfigRef.value.formItems[index].disabled = Number(level) === 2;
+      searchConfigRef.value.formItems[index].defaultValue = itemid;
+    }
+  },
+  {
+    immediate: true
+  }
+);
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+
+  const { start, end } = params;
+
+  if (!params[lockKey]) {
+    ElMessage.warning("请选择业务公司");
+    return;
+  }
+
+  const beyondTime = isBeyondTime({ end,  start, len: 30 });
+  if (beyondTime) return;
+  const data = pageContentRef.value.getData();
+  frontEndExport({ columns: contentConfig.columns, name: "应收账款汇总.xlsx", data });
+}
+</script>
+
+<template>
+  <PageContainer
+    :hooks="hooks"
+    :getContentRef="ref => (pageContentRef = ref)"
+    :content-config="contentConfig"
+    :search-config="searchConfig"
+    lockKey="companyNo"
+  >
+    <template #content_header>
+      <el-button
+        v-if="hasPermissionWithCode('18')"
+        :icon="useRenderIcon('arrow-up-line')"
+        @click="handleExportAllReport"
+        size="small"
+        type="primary"
+        >导出</el-button
+      >
+    </template>
+  </PageContainer>
+</template>

+ 8 - 0
src/views/time/receivableWanyu/config/apis.ts

@@ -0,0 +1,8 @@
+import { createHttpRequest } from "/@/views/time/_http";
+
+const baseUrl = "admin/";
+
+
+export default {
+  list: createHttpRequest(`${baseUrl}stats`, "http://cxinv.api.caixiao365.com/"),
+};

+ 85 - 0
src/views/time/receivableWanyu/config/content.config.ts

@@ -0,0 +1,85 @@
+/* eslint-disable prettier/prettier */
+import { BeforeRequestType, ContentConfig } from "/@/components/PageContent";
+import apis from "./apis";
+import { isBeyondTime } from "/@/views/reportCollection/_utils";
+import { addition } from "/@/utils/calc";
+import { ElMessage } from "element-plus";
+
+const columns = [
+  {
+    label: "业务公司",
+    prop: "depart",
+    cellRenderer({ row }) {
+      return row.depart === '总计' ? row.depart : row.depart.split("@")[1]
+    }
+  },
+  {
+    label: "应收账款",
+    prop: "wpay_fee"
+  },
+  {
+    label: "已开票",
+    prop: "ainv_fee"
+  },
+  {
+    label: "已回款",
+    prop: "apay_fee"
+  },
+  {
+    label: "已开票-已回款",
+    prop: "ainv_apay_fee"
+  },
+  {
+    label: "已开票未回款",
+    prop: "wpay_ainv_fee"
+  },
+  {
+    label: "未开票",
+    prop: "winv_fee"
+  },
+  {
+    label: "待开票",
+    prop: "inv_fee"
+  },
+  {
+    label: "已发货未开票",
+    prop: "winv_asend_fee"
+  },
+  {
+    label: "未发货",
+    prop: "wpay_send_fee"
+  },
+  {
+    label: "超60天已发货未开票",
+    prop: "winv_two_month"
+  },
+  {
+    label: "超180天应收账款",
+    prop: "wpay_six_month"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  columns,
+  responseCode: 0,
+  root: true,
+  handleData(data = []) {
+    return new Promise(resolve => {
+      const totalItem = data.reduce((prev, current) => Object.keys(current).reduce((prev, currentKey) => ({
+        ...prev,
+        [currentKey]: currentKey !== 'depart' ? addition(current[currentKey] || 0, prev[currentKey] || 0) : '总计'
+      }), prev), {})
+
+      resolve([totalItem, ...data])
+    })
+  },
+  tableRowClassName({ rowIndex }) {
+    if (rowIndex === 0) {
+      return "warning-row"
+    }
+  },
+  superUserNoAction: false,
+  apis: { httpList: apis.list }
+};
+
+export default contentConfig;

+ 31 - 0
src/views/time/receivableWanyu/config/search.config.ts

@@ -0,0 +1,31 @@
+import { FormConfig } from "/@/components/PageSearch";
+import dayjs from "dayjs";
+import { useUserStore } from "/@/store/modules/user";
+
+const current = dayjs(new Date()).format("YYYY-MM");
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "date",
+      type: "date_picker",
+      trigger: "change",
+      defaultValue: current,
+      label: '下单月份:',
+      otherOptions: {
+        type: "month",
+        valueFormat: "YYYY-MM",
+        format: "YYYY-MM",
+        clearable: false,
+        // prefix: "下单月份:"
+      }
+    },
+    {
+      field: "depart_id",
+      type: "depart-query",
+      trigger: "change"
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 87 - 0
src/views/time/receivableWanyu/index.vue

@@ -0,0 +1,87 @@
+<script setup lang="ts">
+import { ref , watch} from "vue";
+import searchConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+
+import { PageContentInstance } from "/@/components/PageContent";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { useUserStore } from "/@/store/modules/user";
+import { isBeyondTime } from "/@/views/time/_utils";
+import { frontEndExport } from "/@/utils/export";
+import { usePermission } from "/@/hooks/core";
+import dayjs from "dayjs"
+
+const pageName = "receivableMain";
+const { hasPermissionWithCode } = usePermission(pageName);
+const pageContentRef = ref<PageContentInstance | null>(null);
+const userStore = useUserStore();
+
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch((params) => { 
+    const { date, ...rest } = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+    
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type:"2",
+        ...rest
+      },
+      deleteProps:['date']
+    }
+  },
+   (params) => { 
+    const { date , depart_id} = params;
+    const start = dayjs(date).format('YYYY-MM-DD');
+    const daysInMonth = dayjs(date).daysInMonth();
+    const end = dayjs(start).subtract(-(daysInMonth - 1), 'days').format('YYYY-MM-DD');
+
+    return {
+      result: {
+        start: start + " 00:00:00",
+        end: end + " 23:59:59",
+        plat_type: "1",
+        dz_type: "2",
+        depart_id,
+      },
+      deleteProps:['date']
+    }
+  }, searchConfig)
+};
+
+
+const searchConfigRef = ref(searchConfig);
+watch(
+  () => userStore.level,
+  level => {
+    const { formItems } = searchConfigRef.value;
+    const index = formItems.findIndex(({ field }) => field === "depart_id");
+    const { itemid = "" } = userStore.info || {};
+
+    if (Number(level) === 2) {
+      searchConfigRef.value.formItems[index].disabled = Number(level) === 2;
+      searchConfigRef.value.formItems[index].defaultValue = itemid;
+    }
+  },
+  {
+    immediate: true
+  }
+);
+</script>
+
+<template>
+  <page-auth :page-name="pageName">
+    <page-container
+      :hooks="hooks"
+      :page-name="pageName"
+      :get-content-ref="ref => (pageContentRef = ref)"
+      :content-config="contentConfig"
+    />
+  </page-auth>
+</template>

+ 0 - 0
src/views/time/receivableWanyu/万宇应收-业务公司