|
|
@@ -122,7 +122,7 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <form-dialog :dialogType="diaType" @close="diaType = -1" @export='exportExcel'/>
|
|
|
+ <form-dialog :dialogType="diaType" @close="formDialogClose" @export='exportExcel'/>
|
|
|
<summary-dialog :dialogType="diaType" @close="diaType = -1"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -130,19 +130,19 @@
|
|
|
<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'
|
|
|
import formDialog from '@/views/home/component/form_dialog.vue'
|
|
|
-import {getLazyList} from '@/api/project/index.js'
|
|
|
-import summaryDialog from "@/views/home/component/summary_dialog.vue";
|
|
|
+import { getLazyList } from '@/api/project/index.js'
|
|
|
+import summaryDialog from '@/views/home/component/summary_dialog.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'dash',
|
|
|
- components: {BaseButton, formDialog, summaryDialog},
|
|
|
- setup() {
|
|
|
+ components: { BaseButton, formDialog, summaryDialog },
|
|
|
+ setup () {
|
|
|
const permissions = permissionStore()
|
|
|
- return {permissions}
|
|
|
+ return { permissions }
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
disable: false,
|
|
|
showAdd: false,
|
|
|
@@ -223,11 +223,6 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- {
|
|
|
- label: '项目类型',
|
|
|
- prop: 'projectTypeName',
|
|
|
- width: 180
|
|
|
- },
|
|
|
{
|
|
|
label: '创建时间',
|
|
|
prop: 'createTime',
|
|
|
@@ -253,7 +248,7 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
- {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
],
|
|
|
projectType: [
|
|
|
{
|
|
|
@@ -275,7 +270,7 @@ export default {
|
|
|
queryData: null
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getTypeList()
|
|
|
this.getNumList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
|
@@ -286,20 +281,20 @@ 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({projectStage: item.dictKey})
|
|
|
+ this.onLoad({ projectStage: item.dictKey })
|
|
|
},
|
|
|
- onLoad(query = {}) {
|
|
|
+ onLoad (query = {}) {
|
|
|
this.loading = true
|
|
|
- const data = {...query, parentId: this.parentId}
|
|
|
+ const data = { ...query, parentId: this.parentId }
|
|
|
this.queryData = data
|
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, data).then(res => {
|
|
|
this.loading = false
|
|
|
@@ -314,11 +309,11 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- beforeOpen(done, type) {
|
|
|
+ beforeOpen (done, type) {
|
|
|
if (['edit'].includes(type)) {
|
|
|
this.$router.push({
|
|
|
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') {
|
|
|
// this.$alert('功能建设中,尽情期待...', '消息提醒', {
|
|
|
@@ -326,20 +321,20 @@ export default {
|
|
|
// })
|
|
|
this.$router.push({
|
|
|
path: '/home/pro_detail',
|
|
|
- query: {id: this.form.id}
|
|
|
+ query: { id: this.form.id }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- currentChange(currentPage) {
|
|
|
+ currentChange (currentPage) {
|
|
|
this.page.current = currentPage
|
|
|
},
|
|
|
- sizeChange(pageSize) {
|
|
|
+ sizeChange (pageSize) {
|
|
|
this.page.size = pageSize
|
|
|
},
|
|
|
- refreshChange() {
|
|
|
+ refreshChange () {
|
|
|
this.onLoad()
|
|
|
},
|
|
|
- treeLoad(tree, treeNode, resolve) {
|
|
|
+ treeLoad (tree, treeNode, resolve) {
|
|
|
this.loading = true
|
|
|
getLazyList(tree.id).then(res => {
|
|
|
this.loading = false
|
|
|
@@ -349,24 +344,24 @@ export default {
|
|
|
}))
|
|
|
})
|
|
|
},
|
|
|
- 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)
|
|
|
+ }
|
|
|
})
|
|
|
+ })
|
|
|
},
|
|
|
- getNumList() {
|
|
|
+ getNumList () {
|
|
|
this.$api.project.userNunList().then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.numList = res.data.projectStage
|
|
|
@@ -374,7 +369,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getTotalAmount(data) {
|
|
|
+ getTotalAmount (data) {
|
|
|
this.$api.project.totalAmount(Object.assign(data, this.query)).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.num = res.data
|
|
|
@@ -383,17 +378,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.$api.common.dicList({code: 'project-tags'}).then(res => {
|
|
|
+ this.$api.common.dicList({ code: 'project-tags' }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.tagsList = res.data
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- track(res) {
|
|
|
+ track (res) {
|
|
|
if (res.isReport === 1) {
|
|
|
this.$message.error('该项目已经上报')
|
|
|
return
|
|
|
@@ -403,7 +398,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- const data = {id: res.id, isReport: 1}
|
|
|
+ const data = { id: res.id, isReport: 1 }
|
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
console.log(res)
|
|
|
@@ -414,7 +409,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- projectSave() {
|
|
|
+ projectSave () {
|
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|
|
|
@@ -438,10 +433,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- exportExcel(res) {
|
|
|
- const data = Object.assign(this.queryData, {columnName: res})
|
|
|
+ formDialogClose () {
|
|
|
+ this.diaType = -1
|
|
|
+ this.onLoad()
|
|
|
+ },
|
|
|
+ exportExcel (res) {
|
|
|
+ const data = Object.assign(this.queryData, { columnName: res })
|
|
|
this.$api.params.exportResult(data).then(res => {
|
|
|
- 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')
|
|
|
link.style.display = 'none'
|
|
|
link.href = url
|