|
|
@@ -15,7 +15,8 @@
|
|
|
<span class="ml-15 sp1 mt-5">{{ item.projectNumber }}<span class="grey font-14 ml-5">个</span></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <base-button v-if='permissions.permissions.projectAdd' class="ml-20 mt-20" icon="Plus" title="新增" @click="showAdd = true"/>
|
|
|
+ <base-button v-if='permissions.permissions.projectAdd' class="ml-20 mt-20" icon="Plus" title="新增"
|
|
|
+ @click="showAdd = true"/>
|
|
|
</div>
|
|
|
<avue-crud ref="crud"
|
|
|
v-model="form"
|
|
|
@@ -41,23 +42,25 @@
|
|
|
title="新增项目"
|
|
|
width="35%">
|
|
|
<div>
|
|
|
- <el-form v-model="projectForm" class="lab mt-20" label-width="100px">
|
|
|
+ <el-form ref='form' :model="projectForm" class="lab mt-20" label-width="100px" :rules="rules">
|
|
|
<div class="flex flex-center flex-col mr-20">
|
|
|
- <el-form-item class="full-width" label="项目名称">
|
|
|
+ <el-form-item class="full-width" label="项目名称" prop='name'>
|
|
|
<el-input
|
|
|
v-model="projectForm.name"
|
|
|
clearable
|
|
|
placeholder="输入项目名称"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="full-width" label="项目总投">
|
|
|
+ <el-form-item class="full-width" label="项目总投" prop='totalAmount'>
|
|
|
<el-input
|
|
|
v-model="projectForm.totalAmount"
|
|
|
clearable
|
|
|
- placeholder="输入项目总投"
|
|
|
- />
|
|
|
+ placeholder="输入项目总投(万元)"
|
|
|
+ >
|
|
|
+ <template #append>(万元)</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="full-width" label="项目类型">
|
|
|
+ <el-form-item class="full-width" label="项目类型" prop='projectType'>
|
|
|
<el-select
|
|
|
v-model="projectForm.projectType"
|
|
|
clearable
|
|
|
@@ -72,13 +75,20 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="full-width" label="项目标签">
|
|
|
+ <el-form-item class="full-width" label="项目标签" prop='tags'>
|
|
|
<el-select
|
|
|
v-model="projectForm.tags"
|
|
|
clearable
|
|
|
placeholder="选择项目标签"
|
|
|
style="width: 100%"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in tagsList"
|
|
|
+ :key="item.dictKey"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item class="full-width" label="建设内容">
|
|
|
<el-input
|
|
|
@@ -103,16 +113,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,
|
|
|
@@ -147,21 +157,34 @@ export default {
|
|
|
{
|
|
|
label: '项目总投资(万元)',
|
|
|
prop: 'totalAmount',
|
|
|
- width: 180
|
|
|
+ width: 180,
|
|
|
+ type: 'number',
|
|
|
+ precision: 2,
|
|
|
+ formatter: (val, value, label) => {
|
|
|
+ return val.totalAmount.toLocaleString()
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
label: '项目类型',
|
|
|
prop: 'projectTypeName',
|
|
|
- width: 240
|
|
|
+ type: 'select',
|
|
|
+ width: 240,
|
|
|
+ dicUrl: '/api/blade-system/dict-biz/dictionary?code=project-tags',
|
|
|
+ props: {
|
|
|
+ label: 'dictValue',
|
|
|
+ value: 'dictKey'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
label: '项目领域',
|
|
|
- prop: 'dictName'
|
|
|
+ prop: 'dictName',
|
|
|
+ width: 240
|
|
|
},
|
|
|
{
|
|
|
label: '发债时间',
|
|
|
prop: 'issueDate',
|
|
|
type: 'month',
|
|
|
+ width: 240,
|
|
|
format: 'yyyy-MM',
|
|
|
valueFormat: 'yyyy-MM'
|
|
|
},
|
|
|
@@ -169,6 +192,7 @@ export default {
|
|
|
label: '更新时间',
|
|
|
prop: 'updateTime',
|
|
|
type: 'month',
|
|
|
+ width: 240,
|
|
|
format: 'yyyy-MM-dd',
|
|
|
valueFormat: 'yyyy-MM-dd'
|
|
|
}]
|
|
|
@@ -180,6 +204,7 @@ export default {
|
|
|
},
|
|
|
stage: [],
|
|
|
typeList: [],
|
|
|
+ tagsList: [],
|
|
|
num: '',
|
|
|
projectForm: {
|
|
|
name: '',
|
|
|
@@ -187,10 +212,29 @@ export default {
|
|
|
projectType: '',
|
|
|
tags: '',
|
|
|
introduction: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ projectType: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目类型',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tags: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目标签',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getStageList()
|
|
|
this.getTypeList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
|
@@ -198,16 +242,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 === -1 ? '' : item.id})
|
|
|
+ this.onLoad({ stageId: item.id === -1 ? '' : item.id })
|
|
|
},
|
|
|
// track(id) {
|
|
|
// this.$router.push({
|
|
|
@@ -215,8 +259,8 @@ 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
|
|
|
@@ -226,66 +270,75 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- 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() {
|
|
|
- this.$api.project.projectAdd(this.projectForm).then(res => {
|
|
|
+ this.$api.common.dicList({ code: 'project-tags' }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.showAdd = false
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.showAdd = false
|
|
|
- this.$message.error(res.msg)
|
|
|
+ this.tagsList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ projectSave () {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$api.project.projectAdd(this.projectForm).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.showAdd = false
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.showAdd = false
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|