|
@@ -172,19 +172,19 @@
|
|
|
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'
|
|
|
-import { useStore } from '@/store/user.js'
|
|
|
|
|
|
|
+import {useStore} from '@/store/user.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'dash',
|
|
name: 'dash',
|
|
|
- components: { BaseButton, formDialog, summaryDialog },
|
|
|
|
|
- setup () {
|
|
|
|
|
|
|
+ components: {BaseButton, formDialog, summaryDialog},
|
|
|
|
|
+ setup() {
|
|
|
const permissions = permissionStore()
|
|
const permissions = permissionStore()
|
|
|
const user = useStore()
|
|
const user = useStore()
|
|
|
- return { permissions, user }
|
|
|
|
|
|
|
+ return {permissions, user}
|
|
|
},
|
|
},
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
dialogLoading: false,
|
|
dialogLoading: false,
|
|
|
disable: false,
|
|
disable: false,
|
|
@@ -301,12 +301,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '创建时间',
|
|
|
|
|
- prop: 'create_time',
|
|
|
|
|
- width: 120,
|
|
|
|
|
- formatter: (val, value, label) => {
|
|
|
|
|
- return value.substring(0, 10)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ label: '认定时间',
|
|
|
|
|
+ prop: 'year',
|
|
|
|
|
+ width: 160,
|
|
|
}]
|
|
}]
|
|
|
},
|
|
},
|
|
|
page: {
|
|
page: {
|
|
@@ -328,7 +325,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [
|
|
name: [
|
|
|
- { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
|
|
|
|
+ {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
],
|
|
],
|
|
|
projectType: [
|
|
projectType: [
|
|
|
{
|
|
{
|
|
@@ -353,7 +350,7 @@ export default {
|
|
|
selectList: []
|
|
selectList: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created () {
|
|
|
|
|
|
|
+ created() {
|
|
|
const index = this.option.column.findIndex(sub => sub.prop === 'lot')
|
|
const index = this.option.column.findIndex(sub => sub.prop === 'lot')
|
|
|
const indexLabel = this.option.column.findIndex(sub => sub.prop === 'responsible_unit')
|
|
const indexLabel = this.option.column.findIndex(sub => sub.prop === 'responsible_unit')
|
|
|
console.log(indexLabel)
|
|
console.log(indexLabel)
|
|
@@ -376,19 +373,19 @@ export default {
|
|
|
this.getTypeList()
|
|
this.getTypeList()
|
|
|
this.getNumList()
|
|
this.getNumList()
|
|
|
},
|
|
},
|
|
|
- unmounted () {
|
|
|
|
|
|
|
+ unmounted() {
|
|
|
sessionStorage.removeItem('selectList')
|
|
sessionStorage.removeItem('selectList')
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- switchTab (item, index) {
|
|
|
|
|
|
|
+ switchTab(item, index) {
|
|
|
this.active = index
|
|
this.active = index
|
|
|
this.num = this.numList[index].totalAmount
|
|
this.num = this.numList[index].totalAmount
|
|
|
- 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 = { ...this.owerQuery, parentId: this.parentId }
|
|
|
|
|
|
|
+ const data = {...this.owerQuery, parentId: this.parentId}
|
|
|
this.queryData = data
|
|
this.queryData = data
|
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, this.queryData).then(res => {
|
|
this.$api.project.projectList(this.page.currentPage, this.page.pageSize, this.queryData).then(res => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -404,10 +401,10 @@ 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)) {
|
|
|
if (this.user.info.account !== '15368241401') {
|
|
if (this.user.info.account !== '15368241401') {
|
|
|
this.$confirm('暂未授权使用', {
|
|
this.$confirm('暂未授权使用', {
|
|
@@ -418,26 +415,26 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
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, projectStage: this.form.project_stage }
|
|
|
|
|
|
|
+ query: {id: this.form.id, projectStage: this.form.project_stage}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- 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
|
|
@@ -447,24 +444,24 @@ 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 (data) {
|
|
|
|
|
|
|
+ getNumList(data) {
|
|
|
this.$api.project.userNunList(data).then(res => {
|
|
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
|
|
@@ -472,17 +469,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.is_report === 1) {
|
|
if (res.is_report === 1) {
|
|
|
this.$message.error('该项目已经上报')
|
|
this.$message.error('该项目已经上报')
|
|
|
return
|
|
return
|
|
@@ -492,7 +489,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
}).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 => {
|
|
this.$api.project.proUpdate(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
@@ -503,7 +500,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- projectSave () {
|
|
|
|
|
|
|
+ projectSave() {
|
|
|
if (this.disable) {
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|
|
return
|
|
@@ -527,23 +524,23 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- formDialogClose () {
|
|
|
|
|
|
|
+ formDialogClose() {
|
|
|
if (this.diaType === 0) {
|
|
if (this.diaType === 0) {
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
|
}
|
|
}
|
|
|
this.diaType = -1
|
|
this.diaType = -1
|
|
|
},
|
|
},
|
|
|
- exportExcel (res) {
|
|
|
|
|
- const data = Object.assign({ ...this.queryData }, {
|
|
|
|
|
|
|
+ exportExcel(res) {
|
|
|
|
|
+ const data = Object.assign({...this.queryData}, {
|
|
|
columnName: res,
|
|
columnName: res,
|
|
|
projectIds: this.selectList.join(','),
|
|
projectIds: this.selectList.join(','),
|
|
|
previewType: 1
|
|
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'})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|