Parcourir la source

部门费用管理调整查询方式

lxf il y a 2 mois
Parent
commit
67625afe01
1 fichiers modifiés avec 92 ajouts et 6 suppressions
  1. 92 6
      src/views/finance/fundManage/depExpenses/index.vue

+ 92 - 6
src/views/finance/fundManage/depExpenses/index.vue

@@ -18,7 +18,6 @@
             action: () => deriveExcel(),
           },
         ]"
-        @moreSearch="moreSearch"
         @get-list="getList">
         <template #amount="{ item }">
           <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
@@ -197,6 +196,8 @@ const sourceList = ref({
     remarks: "",
     beginTime: "",
     endTime: "",
+    year: "",
+    month: "",
   },
 });
 let dialogVisible = ref(false);
@@ -216,6 +217,69 @@ const status = ref([
     value: "20",
   },
 ]);
+const year = ref([]);
+const getYear = () => {
+  // 获取当前年份
+  const currentYear = new Date().getFullYear();
+  // 初始化年份数组,从2023年开始
+  for (let yyyy = currentYear; yyyy >= 2023; yyyy--) {
+    year.value.push({
+      label: yyyy,
+      value: yyyy,
+    });
+  }
+};
+getYear();
+const month = ref([
+  {
+    label: "1月",
+    value: "01",
+  },
+  {
+    label: "2月",
+    value: "02",
+  },
+  {
+    label: "3月",
+    value: "03",
+  },
+  {
+    label: "4月",
+    value: "04",
+  },
+  {
+    label: "5月",
+    value: "05",
+  },
+  {
+    label: "6月",
+    value: "06",
+  },
+  {
+    label: "7月",
+    value: "07",
+  },
+  {
+    label: "8月",
+    value: "08",
+  },
+  {
+    label: "9月",
+    value: "09",
+  },
+  {
+    label: "10月",
+    value: "10",
+  },
+  {
+    label: "11月",
+    value: "11",
+  },
+  {
+    label: "12月",
+    value: "12",
+  },
+]);
 const accountCurrency = ref([]);
 import Cookies from "js-cookie";
 const { proxy } = getCurrentInstance();
@@ -236,6 +300,16 @@ const selectConfig = computed(() => {
       prop: "deptId",
       data: deptTreeData.value,
     },
+    {
+      label: "年份",
+      prop: "year",
+      data: year.value,
+    },
+    {
+      label: "月份",
+      prop: "month",
+      data: month.value,
+    },
   ];
 });
 const config = computed(() => {
@@ -347,11 +421,11 @@ const getDept = async () => {
     })
     .then((message) => {
       recursive(message.data);
-      if(message.data && message.data.length > 0) {
-        message.data = message.data.map(item => {
-          item.value = item.deptId
-          return item
-        })
+      if (message.data && message.data.length > 0) {
+        message.data = message.data.map((item) => {
+          item.value = item.deptId;
+          return item;
+        });
       }
       deptTreeData.value = proxy.handleTree(message.data, "corporationId");
     });
@@ -450,6 +524,18 @@ const formConfig = computed(() => {
 });
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  if (sourceList.value.pagination.year) {
+    if (sourceList.value.pagination.month) {
+      sourceList.value.pagination.beginTime = sourceList.value.pagination.year + "-" + sourceList.value.pagination.month + "-01 00:00:00";
+      sourceList.value.pagination.endTime = sourceList.value.pagination.year + "-" + sourceList.value.pagination.month + "-31 23:59:59";
+    } else {
+      sourceList.value.pagination.beginTime = sourceList.value.pagination.year + "-01-01 00:00:00";
+      sourceList.value.pagination.endTime = sourceList.value.pagination.year + "-12-31 23:59:59";
+    }
+  } else {
+    sourceList.value.pagination.beginTime = "";
+    sourceList.value.pagination.endTime = "";
+  }
   loading.value = true;
   proxy.post("/accountDeptRunningWater/page", sourceList.value.pagination).then((message) => {
     sourceList.value.data = message.rows;