|
|
@@ -8,7 +8,7 @@
|
|
|
<span class="ml-5">项目总投资额87847万元</span>
|
|
|
</div>
|
|
|
<div class="flex ml-20">
|
|
|
- <div v-for="(item,index) in stage" :class="active === index ? 'total-s' : 'total'"
|
|
|
+ <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)">
|
|
|
<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>
|
|
|
@@ -16,13 +16,15 @@
|
|
|
</div>
|
|
|
<base-button class="ml-20 mt-20" icon="Plus" title="新增" @click="showAdd = true"/>
|
|
|
</div>
|
|
|
+ {{permissionList}}
|
|
|
<avue-crud ref="crud"
|
|
|
v-model="form"
|
|
|
:before-open="beforeOpen"
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
- :page.sync="page"
|
|
|
+ v-model:page="page"
|
|
|
:table-loading="loading"
|
|
|
+ :permission="permissionList"
|
|
|
class="curd"
|
|
|
@row-del="rowDel"
|
|
|
@current-change="currentChange"
|
|
|
@@ -99,12 +101,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import BaseButton from "../../../components/base-button.vue";
|
|
|
+import BaseButton from '../../../components/base-button.vue'
|
|
|
+import permissionStore from '@/store/permission.js'
|
|
|
+import { vaildData } from '@/utils/tools.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'dash',
|
|
|
- components: {BaseButton},
|
|
|
- data() {
|
|
|
+ components: { BaseButton },
|
|
|
+ setup () {
|
|
|
+ const permissions = permissionStore()
|
|
|
+ return { permissions }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
return {
|
|
|
showAdd: false,
|
|
|
active: 0,
|
|
|
@@ -148,7 +156,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '项目领域',
|
|
|
- prop: 'dictName',
|
|
|
+ prop: 'dictName'
|
|
|
},
|
|
|
{
|
|
|
label: '发债时间',
|
|
|
@@ -177,21 +185,28 @@ export default {
|
|
|
totalAmount: '',
|
|
|
projectType: '',
|
|
|
tags: '',
|
|
|
- introduction: '',
|
|
|
+ introduction: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getStageList()
|
|
|
this.getTypeList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
|
this.onLoad(res)
|
|
|
})
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ 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 })
|
|
|
},
|
|
|
// track(id) {
|
|
|
// this.$router.push({
|
|
|
@@ -199,68 +214,68 @@ export default {
|
|
|
// query: {id: id, type: '1'}
|
|
|
// })
|
|
|
// },
|
|
|
- onLoad(query = {}) {
|
|
|
- let 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.page.total = res.data.numberOfElements
|
|
|
- this.loading = false;
|
|
|
+ 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) {
|
|
|
- this.page.currentPage = currentPage;
|
|
|
+ currentChange (currentPage) {
|
|
|
+ this.page.currentPage = currentPage
|
|
|
},
|
|
|
- sizeChange(pageSize) {
|
|
|
- this.page.pageSize = pageSize;
|
|
|
+ sizeChange (pageSize) {
|
|
|
+ this.page.pageSize = pageSize
|
|
|
},
|
|
|
- refreshChange() {
|
|
|
- this.onLoad(this.page, this.query);
|
|
|
+ refreshChange () {
|
|
|
+ this.onLoad(this.page, this.query)
|
|
|
},
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定删除选择的项目?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ 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
|
|
|
@@ -271,7 +286,7 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|