|
|
@@ -5,11 +5,12 @@
|
|
|
<el-icon class="ml-20" color="#ECAB56">
|
|
|
<WarningFilled/>
|
|
|
</el-icon>
|
|
|
- <span class="ml-5">项目总投资额87847万元</span>
|
|
|
+ <span class="ml-5">项目总投资额{{ num }}万元</span>
|
|
|
</div>
|
|
|
- <div class="flex ml-20">
|
|
|
+ <div class="flex ml-20 hide-scrollbar" style="overflow-x: scroll;width: 86vw">
|
|
|
<div v-for="(item,index) in stage" :key='item.id' :class="active === index ? 'total-s' : 'total'"
|
|
|
- class="flex flex-col flex-align-start flex-center mt-20 bold font-16" @click="switchTab(item,index)">
|
|
|
+ class="flex flex-col flex-align-start flex-center mt-20 bold font-16 pointer"
|
|
|
+ @click="switchTab(item,index)">
|
|
|
<span class="ml-15 sp">{{ item.name }}</span>
|
|
|
<span class="ml-15 sp1 mt-5">{{ item.projectNumber }}<span class="grey font-14 ml-5">个</span></span>
|
|
|
</div>
|
|
|
@@ -18,12 +19,12 @@
|
|
|
</div>
|
|
|
<avue-crud ref="crud"
|
|
|
v-model="form"
|
|
|
+ v-model:page="page"
|
|
|
:before-open="beforeOpen"
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
- v-model:page="page"
|
|
|
- :table-loading="loading"
|
|
|
:permission="permissionList"
|
|
|
+ :table-loading="loading"
|
|
|
class="curd"
|
|
|
@row-del="rowDel"
|
|
|
@current-change="currentChange"
|
|
|
@@ -102,16 +103,16 @@
|
|
|
<script>
|
|
|
import BaseButton from '../../../components/base-button.vue'
|
|
|
import permissionStore from '@/store/permission.js'
|
|
|
-import { vaildData } from '@/utils/tools.js'
|
|
|
+import {vaildData} from '@/utils/tools.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'dash',
|
|
|
- components: { BaseButton },
|
|
|
- setup () {
|
|
|
+ components: {BaseButton},
|
|
|
+ setup() {
|
|
|
const permissions = permissionStore()
|
|
|
- return { permissions }
|
|
|
+ return {permissions}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
showAdd: false,
|
|
|
active: 0,
|
|
|
@@ -179,6 +180,7 @@ export default {
|
|
|
},
|
|
|
stage: [],
|
|
|
typeList: [],
|
|
|
+ num: '',
|
|
|
projectForm: {
|
|
|
name: '',
|
|
|
totalAmount: '',
|
|
|
@@ -188,7 +190,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.getStageList()
|
|
|
this.getTypeList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
|
@@ -196,16 +198,16 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
computed: {
|
|
|
- permissionList () {
|
|
|
+ permissionList() {
|
|
|
return {
|
|
|
delBtn: vaildData(this.permissions.permissions.home_del, false)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- switchTab (item, index) {
|
|
|
+ switchTab(item, index) {
|
|
|
this.active = index
|
|
|
- this.onLoad({ stageId: item.id })
|
|
|
+ this.onLoad({stageId: item.id === -1 ? '' : item.id})
|
|
|
},
|
|
|
// track(id) {
|
|
|
// this.$router.push({
|
|
|
@@ -213,68 +215,69 @@ export default {
|
|
|
// query: {id: id, type: '1'}
|
|
|
// })
|
|
|
// },
|
|
|
- onLoad (query = {}) {
|
|
|
- const data = { ...query, ...this.page }
|
|
|
+ onLoad(query = {}) {
|
|
|
+ const data = {...query, ...this.page}
|
|
|
this.$api.project.projectList(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.content
|
|
|
+ this.num = res.msg
|
|
|
this.page.total = res.data.numberOfElements
|
|
|
this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- beforeOpen (done, type) {
|
|
|
+ beforeOpen(done, type) {
|
|
|
if (['view'].includes(type)) {
|
|
|
this.$router.push({
|
|
|
path: '/home/details',
|
|
|
- query: { id: this.form.id, type: '0' }
|
|
|
+ query: {id: this.form.id, type: '0'}
|
|
|
})
|
|
|
} else if (type === 'edit') {
|
|
|
this.$router.push({
|
|
|
path: '/home/details',
|
|
|
- query: { id: this.form.id, type: '1' }
|
|
|
+ query: {id: this.form.id, type: '1'}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- currentChange (currentPage) {
|
|
|
+ currentChange(currentPage) {
|
|
|
this.page.currentPage = currentPage
|
|
|
},
|
|
|
- sizeChange (pageSize) {
|
|
|
+ sizeChange(pageSize) {
|
|
|
this.page.pageSize = pageSize
|
|
|
},
|
|
|
- refreshChange () {
|
|
|
+ refreshChange() {
|
|
|
this.onLoad(this.page, this.query)
|
|
|
},
|
|
|
- rowDel (row) {
|
|
|
+ rowDel(row) {
|
|
|
this.$confirm('确定删除选择的项目?', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- this.$api.project.projectRemove({ ids: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ .then(() => {
|
|
|
+ this.$api.project.projectRemove({ids: row.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
- getStageList () {
|
|
|
+ getStageList() {
|
|
|
this.$api.project.userStageList().then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.stage = res.data
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getTypeList () {
|
|
|
+ getTypeList() {
|
|
|
this.$api.project.typeList().then(res => {
|
|
|
this.typeList = res.data.records
|
|
|
})
|
|
|
},
|
|
|
- projectSave () {
|
|
|
+ projectSave() {
|
|
|
this.$api.project.projectAdd(this.projectForm).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.showAdd = false
|