| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <template>
- <div class="flex flex-center full-width">
- <div class="full-width flex mt-10">
- <el-col :span="4" v-if="hasChildrenDept">
- <basic-container>
- <left :has-children="hasChildrenDept" @change="changeDept" />
- </basic-container>
- </el-col>
- <el-col :span="hasChildrenDept ? 20 : 24">
- <basic-container>
- <div class="flex flex-align-start">
- <el-select
- v-model="year"
- clearable
- style="width: 15%"
- @change="yearSelect"
- >
- <el-option
- v-for="item in years"
- :key="item.value"
- :label="item.value"
- :value="item.value"
- />
- </el-select>
- </div>
- <div class="mt-20">
- <years :dept-id="dept" :year="year" @change="change" />
- </div>
- </basic-container>
- <basic-container>
- <div class="flex">
- <div
- class="flex-child-average full-width flex flex-col flex-justify-start"
- >
- <div class="flex flex-center flex-justify-between">
- <span class="font-16 bold full-width text-left"
- >投资数据统计 单位(亿元)</span
- >
- <div
- class="flex flex-center"
- :class="isAverage ? 'red' : 'blue'"
- >
- <el-icon>
- <Warning />
- </el-icon>
- <span
- class="full-width text-right ml-5 nowrap mr-20"
- v-if="isAverage"
- >上月未完成平均投资指标</span
- >
- <span class="full-width text-right ml-5 nowrap mr-20" v-else
- >上月已完成平均投资指标</span
- >
- </div>
- </div>
- <div class="full-width mt-10" style="background-color: #f7fafd">
- <chart
- :dept-id="dept"
- :quarter="yearType.value === 0 ? '' : yearType"
- :year="year"
- @avg="avg"
- />
- </div>
- <span class="font-16 bold full-width text-left mt-20"
- >项目入库统计 单位(个)</span
- >
- <div class="full-width mt-10" style="background-color: #f7fafd">
- <chart2
- :dept-id="dept"
- :quarter="
- yearType.value === 0 || yearType === '0' ? '' : yearType
- "
- :year="year"
- />
- </div>
- </div>
- <div class="white-bg padding"></div>
- <div class="flex-child-average">
- <amount
- v-if="user.info.viewStage === 1 && dept === null"
- :type="yearType"
- :deptId="dept"
- :year="year"
- />
- <complete v-else :type="yearType" :deptId="dept" :year="year" />
- </div>
- </div>
- </basic-container>
- </el-col>
- </div>
- </div>
- </template>
- <route>
- {
- path: '/',
- name: '年度投资管理',
- }
- </route>
- <script>
- import BasicContainer from '@/components/basic-container/main.vue'
- import left from './components/left.vue'
- import years from '@/views/invest/components/years.vue'
- import amount from '@/views/invest/components/amount.vue'
- import chart from '@/views/invest/components/chart.vue'
- import chart2 from '@/views/invest/components/chart2.vue'
- import complete from '@/views/invest/components/complete.vue'
- import { useStore } from '@/store/user.js'
- export default {
- name: 'index',
- components: { BasicContainer, left, years, amount, chart, chart2, complete },
- setup() {
- const user = useStore()
- return { user }
- },
- data() {
- return {
- yearType: {
- value: 0
- },
- dept: null,
- year: '',
- hasChildrenDept: false,
- years: [
- {
- value: 2023
- },
- {
- value: 2022
- },
- {
- value: 2021
- },
- {
- value: 2020
- },
- {
- value: 2019
- },
- {
- value: 2018
- },
- {
- value: 2017
- }
- ],
- isAverage: true
- }
- },
- created() {
- this.year = new Date().getFullYear()
- this.isBelowAverage()
- this.deptDetail()
- },
- methods: {
- deptDetail() {
- this.$api.system
- .getDeptDetail({ id: this.user.info.deptId })
- .then(res => {
- if (res.code === 200) {
- this.hasChildrenDept = res.data.hasChildren
- this.dept = res.data.id
- }
- })
- },
- changeDept(res) {
- if (res === null) {
- this.dept = null
- return
- }
- this.dept = res.id
- },
- change(index) {
- this.yearType = index
- },
- yearSelect(res) {
- this.year = res
- },
- isBelowAverage() {
- this.$api.invest.belowAverage().then(res => {
- if (res.code === 200) {
- // this.isAverage = res.data
- }
- })
- },
- avg(res) {
- console.log(res)
- this.isAverage = res
- }
- }
- }
- </script>
- <style scoped></style>
|