|
|
@@ -1,33 +1,33 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div
|
|
|
- class="white-bg top full-height flex flex-col hide-scrollbar"
|
|
|
- style="overflow-y: auto"
|
|
|
+ class="white-bg top full-height flex flex-col hide-scrollbar"
|
|
|
+ style="overflow-y: auto"
|
|
|
>
|
|
|
<div class="flex flex-col flex-center mt-15 padding">
|
|
|
<span class="font-15 bold mb-10">{{ data.name }}</span>
|
|
|
<span class="font-15 bold mt-5" style="color: #787c90"
|
|
|
- >项目总投资额</span
|
|
|
+ >项目总投资额</span
|
|
|
>
|
|
|
<span class="mt-5 font-15 bold main-color"
|
|
|
- >{{
|
|
|
+ >{{
|
|
|
data.total_amount ? data.total_amount.toLocaleString() : '0'
|
|
|
}}万元</span
|
|
|
>
|
|
|
<div class="flex flex-center mt-10">
|
|
|
<!-- <span class="bold mr-15" style="color:#787C90;">{{ currentSituation.dictValue }}</span>-->
|
|
|
<el-select
|
|
|
- v-model="keyWords"
|
|
|
- class="bold"
|
|
|
- :placeholder="currentSituation.dictValue"
|
|
|
- size="small"
|
|
|
- @change="result"
|
|
|
+ v-model="keyWords"
|
|
|
+ class="bold"
|
|
|
+ :placeholder="currentSituation.dictValue"
|
|
|
+ size="small"
|
|
|
+ @change="result"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in dicList"
|
|
|
- :key="item.dictKey"
|
|
|
- :label="item.dictValue"
|
|
|
- :value="item.dictKey"
|
|
|
+ v-for="item in dicList"
|
|
|
+ :key="item.dictKey"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
@@ -35,46 +35,48 @@
|
|
|
<el-divider></el-divider>
|
|
|
<div class="flex flex-center full-width">
|
|
|
<span class="title pointer" @click="showRelation = !showRelation"
|
|
|
- >已关联子项目<span class="bold blue font-16">{{ data.lot }}</span
|
|
|
- >个</span
|
|
|
+ >已关联子项目<span class="bold blue font-16">{{ data.lot }}</span
|
|
|
+ >个</span
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
- class="flex flex-center flex-justify-between flex-col mt-15 hide-scrollbar"
|
|
|
- style="height: 55vh; overflow-x: auto"
|
|
|
+ class="flex flex-center flex-justify-between flex-col mt-15 hide-scrollbar"
|
|
|
+ style="height: 55vh; overflow-x: auto"
|
|
|
>
|
|
|
<div v-if="dicList1 && dicList1.length > 0">
|
|
|
<div
|
|
|
- class="flex flex-center grey-9 font-15 bold pointer"
|
|
|
- :class="active === index ? 'box-s' : 'box'"
|
|
|
- v-for="(item, index) in dicList1"
|
|
|
- :key="item.id"
|
|
|
- @click="change(index)"
|
|
|
+ class="flex flex-center grey-9 font-15 bold pointer"
|
|
|
+ :class="active === index ? 'box-s' : 'box'"
|
|
|
+ v-for="(item, index) in dicList1"
|
|
|
+ :key="item.id"
|
|
|
+ @click="change(index)"
|
|
|
>
|
|
|
{{ item.dictValue }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<div>
|
|
|
- <el-select v-model="year" placeholder="选择年份"
|
|
|
- clearable
|
|
|
- @change="yearSelect"
|
|
|
+ <el-select
|
|
|
+ v-model="year"
|
|
|
+ placeholder="选择年份"
|
|
|
+ clearable
|
|
|
+ @change="yearSelect"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in years"
|
|
|
- :key="item.value"
|
|
|
- :label="item.value"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in years"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div
|
|
|
- class="flex flex-center grey-9 font-15 bold pointer mt-5"
|
|
|
- :class="active === index ? 'box-s' : 'box'"
|
|
|
- v-for="(item, index) in month"
|
|
|
- :key="item"
|
|
|
- @click="change(index)"
|
|
|
+ class="flex flex-center grey-9 font-15 bold pointer mt-5"
|
|
|
+ :class="active === index ? 'box-s' : 'box'"
|
|
|
+ v-for="(item, index) in month"
|
|
|
+ :key="item"
|
|
|
+ @click="change(index)"
|
|
|
>
|
|
|
{{ item.value }}
|
|
|
</div>
|
|
|
@@ -82,10 +84,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<pro-relation
|
|
|
- :showRelation="showRelation"
|
|
|
- :projectId="data.id"
|
|
|
- @close="showRelation = false"
|
|
|
- @success="updateLot"
|
|
|
+ :showRelation="showRelation"
|
|
|
+ :projectId="data.id"
|
|
|
+ @close="showRelation = false"
|
|
|
+ @success="updateLot"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -96,7 +98,7 @@ import month from '@/views/home/component/month.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'pro_left',
|
|
|
- components: {proRelation, month},
|
|
|
+ components: { proRelation, month },
|
|
|
props: {
|
|
|
data: Object,
|
|
|
code: {
|
|
|
@@ -116,7 +118,12 @@ export default {
|
|
|
code: {
|
|
|
handler(val) {
|
|
|
if (val) {
|
|
|
- this.getDic(val)
|
|
|
+ if (val !== 'project_dispatch') {
|
|
|
+ this.getDic(val)
|
|
|
+ } else {
|
|
|
+ this.dicList1.length = 0
|
|
|
+ this.initYear()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
immediate: false
|
|
|
@@ -124,6 +131,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ keyWords: '',
|
|
|
height: 0,
|
|
|
dicList: [],
|
|
|
dicList1: [],
|
|
|
@@ -181,32 +189,10 @@ export default {
|
|
|
{
|
|
|
value: '12月',
|
|
|
index: 11
|
|
|
- },
|
|
|
- ],
|
|
|
- year: '',
|
|
|
- years: [
|
|
|
- {
|
|
|
- value: 2023
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2022
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2021
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2020
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2019
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2018
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2017
|
|
|
}
|
|
|
],
|
|
|
+ year: '',
|
|
|
+ years: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -215,11 +201,23 @@ export default {
|
|
|
this.onScroll()
|
|
|
},
|
|
|
methods: {
|
|
|
- get onScroll(event) {
|
|
|
+ initYear() {
|
|
|
+ this.years.length = 0
|
|
|
+ this.year = new Date().getFullYear()
|
|
|
+ for (let i = 2017; i <= this.year; i++) {
|
|
|
+ const item = { label: i, value: i }
|
|
|
+ this.years.push(item)
|
|
|
+ }
|
|
|
+ this.years.reverse()
|
|
|
+ if (this.dicList1 && this.dicList1.length === 0) {
|
|
|
+ this.active = new Date().getMonth()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onScroll() {
|
|
|
this.$bus.on('scorll', e => {
|
|
|
const scrollTop = e.target.scrollTop
|
|
|
const index = this.scorllTopList.findIndex(
|
|
|
- e => scrollTop >= e.start && scrollTop < e.end
|
|
|
+ e => scrollTop >= e.start && scrollTop < e.end
|
|
|
)
|
|
|
this.active = index
|
|
|
if (e.target.scrollTop === 0) {
|
|
|
@@ -228,12 +226,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getDic(code) {
|
|
|
- this.$api.common.dicList({code}).then(res => {
|
|
|
+ this.$api.common.dicList({ code }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
if (code === 'project-situation') {
|
|
|
this.dicList = res.data
|
|
|
const local = this.dicList.filter(
|
|
|
- e => e.dictKey === this.projectStage
|
|
|
+ e => e.dictKey === this.projectStage
|
|
|
)
|
|
|
if (local.length > 0) {
|
|
|
this.currentSituation = local[0]
|
|
|
@@ -243,12 +241,13 @@ export default {
|
|
|
this.resultList = this.dicList1
|
|
|
this.$emit('success', this.resultList)
|
|
|
this.scorllTopList = []
|
|
|
+ this.active = 0
|
|
|
setTimeout(() => {
|
|
|
for (let i = 0; i < this.resultList.length; i++) {
|
|
|
const start =
|
|
|
- i === 0 ? 0 : document.getElementById('header' + i).offsetTop
|
|
|
+ i === 0 ? 0 : document.getElementById('header' + i).offsetTop
|
|
|
const end = document.getElementById(
|
|
|
- 'header' + (i + 1)
|
|
|
+ 'header' + (i + 1)
|
|
|
).offsetTop
|
|
|
const data = {
|
|
|
index: i,
|
|
|
@@ -269,7 +268,7 @@ export default {
|
|
|
this.$emit('typeChange1')
|
|
|
},
|
|
|
result(item) {
|
|
|
- const data = {id: this.data.id, project_stage: Number.parseInt(item)}
|
|
|
+ const data = { id: this.data.id, project_stage: Number.parseInt(item) }
|
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message.success(res.msg)
|
|
|
@@ -289,6 +288,11 @@ export default {
|
|
|
},
|
|
|
yearSelect(res) {
|
|
|
this.year = res
|
|
|
+ if (this.year !== new Date().getFullYear()) {
|
|
|
+ this.active = 0
|
|
|
+ this.change(0)
|
|
|
+ }
|
|
|
+ this.$emit('year', this.year)
|
|
|
}
|
|
|
}
|
|
|
}
|