|
@@ -42,7 +42,7 @@
|
|
|
@on-load="onLoad">
|
|
@on-load="onLoad">
|
|
|
<template #menu="{row}">
|
|
<template #menu="{row}">
|
|
|
<el-button icon="Upload" type='primary' text @click="track(row)"> {{
|
|
<el-button icon="Upload" type='primary' text @click="track(row)"> {{
|
|
|
- row.isReport === 1 ? "已上报" : "项目上报"
|
|
|
|
|
|
|
+ row.isReport === 1 ? "已经上报" : "项目上报"
|
|
|
}}
|
|
}}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -126,18 +126,18 @@
|
|
|
<script>
|
|
<script>
|
|
|
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 { vaildData } from '@/utils/tools.js'
|
|
|
|
|
|
|
+import {vaildData} from '@/utils/tools.js'
|
|
|
import form_dialog from '@/views/home/component/form_dialog.vue'
|
|
import form_dialog from '@/views/home/component/form_dialog.vue'
|
|
|
-import { getLazyList } from '@/api/project/index.js'
|
|
|
|
|
|
|
+import {getLazyList} from '@/api/project/index.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'dash',
|
|
name: 'dash',
|
|
|
- components: { BaseButton, form_dialog },
|
|
|
|
|
- setup () {
|
|
|
|
|
|
|
+ components: {BaseButton, form_dialog},
|
|
|
|
|
+ setup() {
|
|
|
const permissions = permissionStore()
|
|
const permissions = permissionStore()
|
|
|
- return { permissions }
|
|
|
|
|
|
|
+ return {permissions}
|
|
|
},
|
|
},
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
disable: false,
|
|
disable: false,
|
|
|
showAdd: false,
|
|
showAdd: false,
|
|
@@ -265,7 +265,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [
|
|
name: [
|
|
|
- { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
|
|
|
|
+ {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
],
|
|
],
|
|
|
projectType: [
|
|
projectType: [
|
|
|
{
|
|
{
|
|
@@ -286,27 +286,27 @@ export default {
|
|
|
parentId: 0
|
|
parentId: 0
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created () {
|
|
|
|
|
|
|
+ created() {
|
|
|
this.getTypeList()
|
|
this.getTypeList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
this.$bus.on('serach', (res) => {
|
|
|
this.onLoad(res)
|
|
this.onLoad(res)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- permissionList () {
|
|
|
|
|
|
|
+ permissionList() {
|
|
|
return {
|
|
return {
|
|
|
delBtn: vaildData(this.permissions.permissions.home_del, false)
|
|
delBtn: vaildData(this.permissions.permissions.home_del, false)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- switchTab (item, index) {
|
|
|
|
|
|
|
+ switchTab(item, index) {
|
|
|
this.active = index
|
|
this.active = index
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
|
},
|
|
},
|
|
|
- onLoad (query = {}) {
|
|
|
|
|
|
|
+ onLoad(query = {}) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
- const data = { ...query, parentId: this.parentId }
|
|
|
|
|
|
|
+ const data = {...query, parentId: this.parentId}
|
|
|
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) {
|
|
@@ -320,11 +320,11 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- 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.$alert('功能建设中,尽情期待...', '消息提醒', {
|
|
// this.$alert('功能建设中,尽情期待...', '消息提醒', {
|
|
@@ -332,51 +332,51 @@ export default {
|
|
|
// })
|
|
// })
|
|
|
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
|
|
|
resolve(res.data.data.childrenList)
|
|
resolve(res.data.data.childrenList)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- 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)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
- getStageList () {
|
|
|
|
|
|
|
+ getStageList() {
|
|
|
this.$api.project.userStageList().then(res => {
|
|
this.$api.project.userStageList().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.stage = res.data
|
|
this.stage = res.data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getTotalAmount (data) {
|
|
|
|
|
|
|
+ getTotalAmount(data) {
|
|
|
this.$api.project.totalAmount(Object.assign(data, this.query)).then(res => {
|
|
this.$api.project.totalAmount(Object.assign(data, this.query)).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.num = res.data
|
|
this.num = res.data
|
|
@@ -385,17 +385,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- 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
|
|
@@ -405,7 +405,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)
|
|
@@ -416,7 +416,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- projectSave () {
|
|
|
|
|
|
|
+ projectSave() {
|
|
|
if (this.disable) {
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|
|
return
|