|
@@ -76,21 +76,21 @@
|
|
|
<template #append>(万元)</template>
|
|
<template #append>(万元)</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item class="full-width" label="项目类型" prop='projectType'>
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="projectForm.projectType"
|
|
|
|
|
- clearable
|
|
|
|
|
- placeholder="选择项目类型"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in typeList"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ <!-- <el-form-item class="full-width" label="项目类型" prop='projectType'>-->
|
|
|
|
|
+ <!-- <el-select-->
|
|
|
|
|
+ <!-- v-model="projectForm.projectType"-->
|
|
|
|
|
+ <!-- clearable-->
|
|
|
|
|
+ <!-- placeholder="选择项目类型"-->
|
|
|
|
|
+ <!-- style="width: 100%"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- <el-option-->
|
|
|
|
|
+ <!-- v-for="item in typeList"-->
|
|
|
|
|
+ <!-- :key="item.id"-->
|
|
|
|
|
+ <!-- :label="item.name"-->
|
|
|
|
|
+ <!-- :value="item.id"-->
|
|
|
|
|
+ <!-- />-->
|
|
|
|
|
+ <!-- </el-select>-->
|
|
|
|
|
+ <!-- </el-form-item>-->
|
|
|
<el-form-item class="full-width" label="项目标签" prop='tags'>
|
|
<el-form-item class="full-width" label="项目标签" prop='tags'>
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="projectForm.tags"
|
|
v-model="projectForm.tags"
|
|
@@ -133,17 +133,17 @@
|
|
|
import BaseButton from '../../../components/base-button.vue'
|
|
import BaseButton from '../../../components/base-button.vue'
|
|
|
import permissionStore from '@/store/permission.js'
|
|
import permissionStore from '@/store/permission.js'
|
|
|
import formDialog from '@/views/home/component/form_dialog.vue'
|
|
import formDialog from '@/views/home/component/form_dialog.vue'
|
|
|
-import { getLazyList } from '@/api/project/index.js'
|
|
|
|
|
|
|
+import {getLazyList} from '@/api/project/index.js'
|
|
|
import summaryDialog from '@/views/home/component/summary_dialog.vue'
|
|
import summaryDialog from '@/views/home/component/summary_dialog.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'dash',
|
|
name: 'dash',
|
|
|
- components: { BaseButton, formDialog, summaryDialog },
|
|
|
|
|
- setup () {
|
|
|
|
|
|
|
+ components: {BaseButton, formDialog, summaryDialog},
|
|
|
|
|
+ setup() {
|
|
|
const permissions = permissionStore()
|
|
const permissions = permissionStore()
|
|
|
- return { permissions }
|
|
|
|
|
|
|
+ return {permissions}
|
|
|
},
|
|
},
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
dialogLoading: false,
|
|
dialogLoading: false,
|
|
|
disable: false,
|
|
disable: false,
|
|
@@ -251,7 +251,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [
|
|
name: [
|
|
|
- { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
|
|
|
|
+ {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
],
|
|
],
|
|
|
projectType: [
|
|
projectType: [
|
|
|
{
|
|
{
|
|
@@ -276,8 +276,7 @@ export default {
|
|
|
selectList: []
|
|
selectList: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created () {
|
|
|
|
|
- this.getNumList()
|
|
|
|
|
|
|
+ created() {
|
|
|
this.$bus.on('serach', (res, type) => {
|
|
this.$bus.on('serach', (res, type) => {
|
|
|
this.owerQuery = res
|
|
this.owerQuery = res
|
|
|
if (res.type === false) {
|
|
if (res.type === false) {
|
|
@@ -287,19 +286,20 @@ export default {
|
|
|
this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
|
|
this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- unmounted () {
|
|
|
|
|
|
|
+ unmounted() {
|
|
|
sessionStorage.removeItem('selectList')
|
|
sessionStorage.removeItem('selectList')
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- switchTab (item, index) {
|
|
|
|
|
|
|
+ switchTab(item, index) {
|
|
|
this.active = index
|
|
this.active = index
|
|
|
- this.projectStageQuery = { projectStage: item.dictKey }
|
|
|
|
|
|
|
+ this.projectStageQuery = {projectStage: item.dictKey}
|
|
|
this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
|
|
this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
|
|
|
},
|
|
},
|
|
|
- onLoad (query = {}) {
|
|
|
|
|
|
|
+ onLoad(query = {}) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
- const data = { ...query, parentId: this.parentId }
|
|
|
|
|
|
|
+ const data = {...query, parentId: this.parentId}
|
|
|
this.queryData = data
|
|
this.queryData = data
|
|
|
|
|
+ this.getNumList(data)
|
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, data).then(res => {
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, data).then(res => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -314,32 +314,32 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- selectionChange (list) {
|
|
|
|
|
|
|
+ selectionChange(list) {
|
|
|
this.selectList = list.map(sub => sub.id)
|
|
this.selectList = list.map(sub => sub.id)
|
|
|
},
|
|
},
|
|
|
- beforeOpen (done, type) {
|
|
|
|
|
|
|
+ beforeOpen(done, type) {
|
|
|
if (['edit'].includes(type)) {
|
|
if (['edit'].includes(type)) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: '/home/details',
|
|
path: '/home/details',
|
|
|
- query: { id: this.form.id, type: '0', ownerId: this.form.createUser }
|
|
|
|
|
|
|
+ query: {id: this.form.id, type: '0', ownerId: this.form.createUser}
|
|
|
})
|
|
})
|
|
|
} else if (type === 'view') {
|
|
} else if (type === 'view') {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: '/home/pro_detail',
|
|
path: '/home/pro_detail',
|
|
|
- query: { id: this.form.id }
|
|
|
|
|
|
|
+ query: {id: this.form.id}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- currentChange (currentPage) {
|
|
|
|
|
|
|
+ currentChange(currentPage) {
|
|
|
this.page.current = currentPage
|
|
this.page.current = currentPage
|
|
|
},
|
|
},
|
|
|
- sizeChange (pageSize) {
|
|
|
|
|
|
|
+ sizeChange(pageSize) {
|
|
|
this.page.size = pageSize
|
|
this.page.size = pageSize
|
|
|
},
|
|
},
|
|
|
- refreshChange () {
|
|
|
|
|
|
|
+ refreshChange() {
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
|
},
|
|
},
|
|
|
- treeLoad (tree, treeNode, resolve) {
|
|
|
|
|
|
|
+ treeLoad(tree, treeNode, resolve) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
getLazyList(tree.id).then(res => {
|
|
getLazyList(tree.id).then(res => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -349,42 +349,42 @@ export default {
|
|
|
}))
|
|
}))
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- rowDel (row) {
|
|
|
|
|
|
|
+ rowDel(row) {
|
|
|
this.$confirm('确定删除选择的项目?', {
|
|
this.$confirm('确定删除选择的项目?', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
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)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
- getNumList () {
|
|
|
|
|
- this.$api.project.userNunList().then(res => {
|
|
|
|
|
|
|
+ getNumList(data) {
|
|
|
|
|
+ this.$api.project.userNunList(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.numList = res.data.projectStage
|
|
this.numList = res.data.projectStage
|
|
|
this.num = res.data.totalAmount
|
|
this.num = res.data.totalAmount
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getTypeList () {
|
|
|
|
|
- this.$api.project.typeList({ type: 1, size: 999, current: 1 }).then(res => {
|
|
|
|
|
|
|
+ getTypeList() {
|
|
|
|
|
+ this.$api.project.typeList({type: 1, size: 999, current: 1}).then(res => {
|
|
|
this.typeList = res.data.records
|
|
this.typeList = res.data.records
|
|
|
})
|
|
})
|
|
|
- this.$api.common.dicList({ code: 'project-tags' }).then(res => {
|
|
|
|
|
|
|
+ this.$api.common.dicList({code: 'project-tags'}).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.tagsList = res.data
|
|
this.tagsList = res.data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- track (res) {
|
|
|
|
|
|
|
+ track(res) {
|
|
|
if (res.isReport === 1) {
|
|
if (res.isReport === 1) {
|
|
|
this.$message.error('该项目已经上报')
|
|
this.$message.error('该项目已经上报')
|
|
|
return
|
|
return
|
|
@@ -394,7 +394,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
- const data = { id: res.id, isReport: 1 }
|
|
|
|
|
|
|
+ const data = {id: res.id, isReport: 1}
|
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -405,7 +405,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- projectSave () {
|
|
|
|
|
|
|
+ projectSave() {
|
|
|
if (this.disable) {
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|
|
return
|
|
@@ -429,18 +429,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- formDialogClose () {
|
|
|
|
|
|
|
+ formDialogClose() {
|
|
|
this.diaType = -1
|
|
this.diaType = -1
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
|
},
|
|
},
|
|
|
- exportExcel (res) {
|
|
|
|
|
- const data = Object.assign(this.queryData, { columnName: res, projectIds: this.selectList.join(',') })
|
|
|
|
|
|
|
+ exportExcel(res) {
|
|
|
|
|
+ const data = Object.assign(this.queryData, {columnName: res, projectIds: this.selectList.join(',')})
|
|
|
this.$api.params.exportResult(data).then(res => {
|
|
this.$api.params.exportResult(data).then(res => {
|
|
|
if (res.hasOwnProperty('code')) {
|
|
if (res.hasOwnProperty('code')) {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
|
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}))
|
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
|
link.href = url
|
|
link.href = url
|
|
@@ -453,14 +453,14 @@ export default {
|
|
|
this.$message.success('导出成功')
|
|
this.$message.success('导出成功')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- exportExcelTotal (item) {
|
|
|
|
|
- const data = { projectIds: this.selectList.join(',') }
|
|
|
|
|
|
|
+ exportExcelTotal(item) {
|
|
|
|
|
+ const data = {...this.queryData, projectIds: this.selectList.join(',')}
|
|
|
this.$api.params.summaryExport(Object.assign(item, data)).then(res => {
|
|
this.$api.params.summaryExport(Object.assign(item, data)).then(res => {
|
|
|
if (res.hasOwnProperty('code')) {
|
|
if (res.hasOwnProperty('code')) {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
|
|
|
|
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}))
|
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
|
link.href = url
|
|
link.href = url
|