|
|
@@ -172,19 +172,19 @@
|
|
|
import BaseButton from '../../../components/base-button.vue'
|
|
|
import permissionStore from '@/store/permission.js'
|
|
|
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 {useStore} from '@/store/user.js'
|
|
|
+import { useStore } from '@/store/user.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'dash',
|
|
|
- components: {BaseButton, formDialog, summaryDialog},
|
|
|
- setup() {
|
|
|
+ components: { BaseButton, formDialog, summaryDialog },
|
|
|
+ setup () {
|
|
|
const permissions = permissionStore()
|
|
|
const user = useStore()
|
|
|
- return {permissions, user}
|
|
|
+ return { permissions, user }
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dialogLoading: false,
|
|
|
disable: false,
|
|
|
@@ -303,7 +303,7 @@ export default {
|
|
|
{
|
|
|
label: '认定时间',
|
|
|
prop: 'year',
|
|
|
- width: 160,
|
|
|
+ width: 160
|
|
|
}]
|
|
|
},
|
|
|
page: {
|
|
|
@@ -325,7 +325,7 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
- {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
],
|
|
|
projectType: [
|
|
|
{
|
|
|
@@ -347,10 +347,12 @@ export default {
|
|
|
queryData: null,
|
|
|
owerQuery: {},
|
|
|
projectStageQuery: {},
|
|
|
- selectList: []
|
|
|
+ selectList: [],
|
|
|
+ dev: false
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
+ this.dev = sessionStorage.getItem('dev') === 'true'
|
|
|
const index = this.option.column.findIndex(sub => sub.prop === 'lot')
|
|
|
const indexLabel = this.option.column.findIndex(sub => sub.prop === 'responsible_unit')
|
|
|
console.log(indexLabel)
|
|
|
@@ -373,19 +375,19 @@ export default {
|
|
|
this.getTypeList()
|
|
|
this.getNumList()
|
|
|
},
|
|
|
- unmounted() {
|
|
|
+ unmounted () {
|
|
|
sessionStorage.removeItem('selectList')
|
|
|
},
|
|
|
methods: {
|
|
|
- switchTab(item, index) {
|
|
|
+ switchTab (item, index) {
|
|
|
this.active = index
|
|
|
this.num = this.numList[index].totalAmount
|
|
|
- this.projectStageQuery = {projectStage: item.dictKey}
|
|
|
+ this.projectStageQuery = { projectStage: item.dictKey }
|
|
|
this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
|
|
|
},
|
|
|
- onLoad(query = {}) {
|
|
|
+ onLoad (query = {}) {
|
|
|
this.loading = true
|
|
|
- const data = {...this.owerQuery, parentId: this.parentId}
|
|
|
+ const data = { ...this.owerQuery, parentId: this.parentId }
|
|
|
this.queryData = data
|
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, this.queryData).then(res => {
|
|
|
this.loading = false
|
|
|
@@ -393,6 +395,8 @@ export default {
|
|
|
this.data = res.data.records.map(e => {
|
|
|
e.projectStage = e.projectStage + ''
|
|
|
e.selected = true
|
|
|
+ const xian = e.name.indexOf('县')
|
|
|
+ e.name = this.dev ? e.name.substring(xian + 1) : e.name
|
|
|
return e
|
|
|
})
|
|
|
this.page.total = res.data.total
|
|
|
@@ -401,10 +405,10 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- selectionChange(list) {
|
|
|
+ selectionChange (list) {
|
|
|
this.selectList = list.map(sub => sub.id)
|
|
|
},
|
|
|
- beforeOpen(done, type) {
|
|
|
+ beforeOpen (done, type) {
|
|
|
if (['edit'].includes(type)) {
|
|
|
if (this.user.info.account !== '15368241401') {
|
|
|
this.$confirm('暂未授权使用', {
|
|
|
@@ -415,26 +419,26 @@ export default {
|
|
|
} else {
|
|
|
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.$router.push({
|
|
|
path: '/home/pro_detail',
|
|
|
- query: {id: this.form.id, projectStage: this.form.project_stage}
|
|
|
+ query: { id: this.form.id, projectStage: this.form.project_stage }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- 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
|
|
|
@@ -444,24 +448,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(data) {
|
|
|
+ getNumList (data) {
|
|
|
this.$api.project.userNunList(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.numList = res.data.projectStage
|
|
|
@@ -469,17 +473,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.is_report === 1) {
|
|
|
this.$message.error('该项目已经上报')
|
|
|
return
|
|
|
@@ -489,7 +493,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- const data = {id: res.id, is_report: 1, project_stage: res.project_stage === 1 ? 2 : res.project_stage}
|
|
|
+ const data = { id: res.id, is_report: 1, project_stage: res.project_stage === 1 ? 2 : res.project_stage }
|
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.onLoad()
|
|
|
@@ -500,7 +504,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- projectSave() {
|
|
|
+ projectSave () {
|
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|
|
|
@@ -524,23 +528,23 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- formDialogClose() {
|
|
|
+ formDialogClose () {
|
|
|
if (this.diaType === 0) {
|
|
|
this.onLoad()
|
|
|
}
|
|
|
this.diaType = -1
|
|
|
},
|
|
|
- exportExcel(res) {
|
|
|
- const data = Object.assign({...this.queryData}, {
|
|
|
+ exportExcel (res) {
|
|
|
+ const data = Object.assign({ ...this.queryData }, {
|
|
|
columnName: res,
|
|
|
projectIds: this.selectList.join(','),
|
|
|
previewType: 1
|
|
|
})
|
|
|
- this.$router.push({query: data, path: '/home/excel'})
|
|
|
+ this.$router.push({ query: data, path: '/home/excel' })
|
|
|
},
|
|
|
- exportExcelTotal(item) {
|
|
|
- const dataIds = {...this.queryData, ...item, projectIds: this.selectList.join(','), previewType: 2}
|
|
|
- this.$router.push({query: dataIds, path: '/home/excel'})
|
|
|
+ exportExcelTotal (item) {
|
|
|
+ const dataIds = { ...this.queryData, ...item, projectIds: this.selectList.join(','), previewType: 2 }
|
|
|
+ this.$router.push({ query: dataIds, path: '/home/excel' })
|
|
|
}
|
|
|
}
|
|
|
}
|