瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

2545307760@qq.com 7 月之前
父節點
當前提交
c0c7a8542f
共有 2 個文件被更改,包括 46 次插入7 次删除
  1. 4 4
      web/src/api/cost.js
  2. 42 3
      web/src/view/dashboard/index.vue

+ 4 - 4
web/src/api/cost.js

@@ -50,17 +50,17 @@ export const peopleCost = (data) => {
 }
 
 // 查询项目月费用
-export const queryProjectMonthFee = (month, year) => {
+export const queryProjectMonthFee = (month, year, code) => {
   return service({
-    url: '/expenses/queryProjectMonthFee?monthTime=' + month + '&yearTime=' + year,
+    url: '/expenses/queryProjectMonthFee?monthTime=' + month + '&yearTime=' + year + '&code=' + code,
     method: 'get',
   })
 }
 
 // 查询公司月费用
-export const queryMonthExpenses = (month, year) => {
+export const queryMonthExpenses = (month, year, genre) => {
   return service({
-    url: '/expenses/queryMonthExpenses?monthTime=' + month + '&yearTime=' + year,
+    url: '/expenses/queryMonthExpenses?monthTime=' + month + '&yearTime=' + year + '&genre=' + genre,
     method: 'get',
   })
 }

+ 42 - 3
web/src/view/dashboard/index.vue

@@ -52,7 +52,7 @@
             </el-col>
             <el-col
               :xs="24"
-              :sm="8"
+              :sm="4"
             >
               <el-date-picker
                 v-model="yearData"
@@ -63,6 +63,25 @@
                 @change="choiceYear"
               />
             </el-col>
+            <el-col
+              :xs="24"
+              :sm="4"
+            >
+              <el-select
+                v-model="feeGenre"
+                clearable
+                filterable
+                value-on-clear=""
+                @change="changeFeeGenre"
+              >
+                <el-option
+                  v-for="item in feeGenreData"
+                  :key="item.ID"
+                  :label="item.name"
+                  :value="item.ID"
+                />
+              </el-select>
+            </el-col>
             <el-col
               :xs="24"
               :sm="6"
@@ -79,19 +98,24 @@
                 :data="projectMonthFee"
                 max-height="400px"
                 height="400px"
+                show-summary
+                table-layout="auto"
               >
                 <el-table-column
                   prop="projectFeeGenre.name"
                   label="费用类型"
                   width="200"
+                  align="center"
                 />
                 <el-table-column
                   prop="totalExpenditure"
                   label="支出金额"
+                  align="center"
                 />
                 <el-table-column
                   prop="totalDeposit"
                   label="支入金额"
+                  align="center"
                 />
               </el-table>
             </el-col>
@@ -103,19 +127,24 @@
                 :data="monthFee"
                 max-height="400px"
                 height="400px"
+                table-layout="auto"
+                show-summary
               >
                 <el-table-column
                   prop="department.name"
                   label="部门"
                   width="200"
+                  align="center"
                 />
                 <el-table-column
                   prop="totalExpenditure"
                   label="支出金额"
+                  align="center"
                 />
                 <el-table-column
                   prop="totalDeposit"
                   label="支入金额"
+                  align="center"
                 />
               </el-table>
             </el-col>
@@ -131,6 +160,7 @@ import { ref, onMounted } from 'vue'
 import { getAllProject, queryProjectSum } from '@/api/project'
 import * as echarts from 'echarts'
 import { queryMonthExpenses, queryProjectMonthFee } from '@/api/cost'
+import { queryExpensesGenre } from '@/api/finance'
 
 let myChart = null
 
@@ -170,11 +200,13 @@ const initChart = () => {
 const monthData = ref('')
 const yearData = ref('')
 const project1 = ref('')
+const feeGenre = ref('')
 
 const projectSum = ref()
 const projectMonthFee = ref()
 const monthFee = ref()
 const projectData = ref()
+const feeGenreData = ref()
 
 const xData = ref([])
 const queryData = async() => {
@@ -185,15 +217,18 @@ const queryData = async() => {
       xData.value.push(projectSum.value[key])
     }
   })
-  await queryProjectMonthFee(monthData.value, yearData.value).then(res => {
+  await queryProjectMonthFee(monthData.value, yearData.value, project1.value).then(res => {
     projectMonthFee.value = res.data
   })
-  await queryMonthExpenses(monthData.value, yearData.value).then(res => {
+  await queryMonthExpenses(monthData.value, yearData.value, feeGenre.value).then(res => {
     monthFee.value = res.data
   })
   await getAllProject().then(res => {
     projectData.value = res.data
   })
+  await queryExpensesGenre().then(res => {
+    feeGenreData.value = res.data
+  })
   initChart()
 }
 
@@ -211,6 +246,10 @@ const changeCode = () => {
   queryData()
 }
 
+const changeFeeGenre = () => {
+  queryData()
+}
+
 const choiceMonth = () => {
   yearData.value = ''
   queryData()