scorpioyq 2 years ago
parent
commit
501f410b86

+ 5 - 5
src/views/dash/compoents/data_show.vue

@@ -8,29 +8,29 @@
     </div>
     <div
       class="flex flex-center flex-justify-between mb-15 ml-20"
-      style="margin-top: 65px"
+      style="margin-top: 50px"
     >
       <div class="flex flex-col flex-center">
         <span class="bold">全部项目数</span>
-        <span class="mt-10 font-34 main-color"
+        <span class="mt-15 font-34 main-color"
           >{{ data.projectCount }}<span class="font-13 black"> 个</span></span
         >
       </div>
       <div class="flex flex-col flex-center">
         <span class="bold">全部报告数</span>
-        <span class="mt-10 font-34 main-color"
+        <span class="mt-15 font-34 main-color"
           >{{ data.fileCount }}<span class="font-13 black"> 篇</span></span
         >
       </div>
       <div class="flex flex-col flex-center">
         <span class="bold">我的项目数</span>
-        <span class="mt-10 font-34 main-color"
+        <span class="mt-15 font-34 main-color"
           >{{ data.myProjectCount }}<span class="font-13 black"> 个</span></span
         >
       </div>
       <div class="flex flex-col flex-center mr-20">
         <span class="bold">我的报告数</span>
-        <span class="mt-10 font-34 main-color"
+        <span class="mt-15 font-34 main-color"
           >{{ data.myFileCount }}<span class="font-13 black"> 篇</span></span
         >
       </div>

+ 98 - 0
src/views/dash/compoents/owner.vue

@@ -0,0 +1,98 @@
+<template>
+  <div class="flex full-width flex-col">
+    <div class="flex flex-center full-width flex-justify-between">
+      <span class="bold font-16">{{ user.info.deptName }}</span>
+      <span class="font-13 grey-9 mr-10">数据统计时间:{{ date }}</span>
+    </div>
+    <div
+      class="flex flex-center flex-justify-between mb-15 ml-20"
+      style="margin-top: 50px"
+    >
+      <div class="flex flex-col flex-center">
+        <span class="bold">年度责任目标</span>
+        <span class="mt-15 font-34 main-color"
+          >{{ info.plan_complete_amount
+          }}<span class="font-13 black">万元</span></span
+        >
+      </div>
+      <div class="flex flex-col flex-center">
+        <span class="bold">累计完成投资</span>
+        <span class="mt-15 font-34 main-color"
+          >{{ info.total_complete_amount
+          }}<span class="font-13 black">万元</span></span
+        >
+      </div>
+      <div class="flex flex-col flex-center">
+        <span class="bold">投资完成比例</span>
+        <span class="mt-15 font-34 main-color"
+          >{{ info.rate }}<span class="font-13 black"></span
+        ></span>
+      </div>
+      <div class="flex flex-col flex-center mr-20">
+        <span class="bold">当月计划投资</span>
+        <span class="mt-15 font-34 main-color"
+          >{{ info.month_plan_complete_amount
+          }}<span class="font-13 black">万元</span></span
+        >
+      </div>
+      <div class="flex flex-col flex-center mr-20">
+        <span class="bold">当月完成投资</span>
+        <span class="mt-15 font-34 main-color"
+          >{{ info.month_total_complete_amount
+          }}<span class="font-13 black">万元</span></span
+        >
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { useStore } from '@/store/user.js'
+
+export default {
+  name: 'owner',
+  setup() {
+    const user = useStore()
+    return { user }
+  },
+  data() {
+    return {
+      date: '',
+      year: '',
+      info: {}
+    }
+  },
+  created() {
+    this.fetch()
+    // 获取当前日期
+    const date = new Date()
+    let nowMonth = date.getMonth() + 1
+    let strDate = date.getDate()
+    const seperator = '-'
+    if (nowMonth >= 1 && nowMonth <= 9) {
+      nowMonth = '0' + nowMonth
+    }
+    if (strDate >= 0 && strDate <= 9) {
+      strDate = '0' + strDate
+    }
+    this.date = date.getFullYear() + seperator + nowMonth + seperator + strDate
+  },
+  methods: {
+    fetch() {
+      let params = {
+        deptId: this.user.info.deptId,
+        year: new Date().getFullYear()
+      }
+      this.$api.invest.homeInvest(params).then(res => {
+        if (res.code === 200) {
+          this.info = res.data
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss"></style>

+ 18 - 2
src/views/dash/index.vue

@@ -5,7 +5,10 @@
         <notice :data="noticeList" />
       </div>
     </el-card>
-    <div class="flex flex-center flex-justify-between">
+    <div
+      v-if="user.info.type === 4"
+      class="flex flex-center flex-justify-between"
+    >
       <el-card :shadow="hover" class="flex-child-average mt-20 card1">
         <profile />
       </el-card>
@@ -14,6 +17,13 @@
         <data-show />
       </el-card>
     </div>
+    <el-card
+      v-if="user.info.type === 3"
+      :shadow="hover"
+      class="flex-child-average mt-20 card1"
+    >
+      <owner />
+    </el-card>
     <div class="flex flex-center flex-justify-between">
       <el-card
         :shadow="hover"
@@ -45,14 +55,20 @@ name: '首页',
 </route>
 
 <script>
+import { useStore } from '@/store/user.js'
 import Profile from '@/views/dash/compoents/profile.vue'
 import dataShow from '@/views/dash/compoents/data_show.vue'
 import agency from '@/views/dash/compoents/agency.vue'
 import read from '@/views/dash/compoents/read.vue'
 import notice from '@/views/dash/compoents/notice.vue'
+import owner from '@/views/dash/compoents/owner.vue'
 
 export default {
-  components: { Profile, dataShow, agency, read, notice },
+  components: { Profile, dataShow, agency, read, notice, owner },
+  setup() {
+    const user = useStore()
+    return { user }
+  },
   data() {
     return {
       page: {