|
|
@@ -126,18 +126,18 @@
|
|
|
<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 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 {
|
|
|
name: 'dash',
|
|
|
- components: {BaseButton, form_dialog},
|
|
|
- setup() {
|
|
|
+ components: { BaseButton, form_dialog },
|
|
|
+ setup () {
|
|
|
const permissions = permissionStore()
|
|
|
- return {permissions}
|
|
|
+ return { permissions }
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
disable: false,
|
|
|
showAdd: false,
|
|
|
@@ -152,6 +152,7 @@ export default {
|
|
|
lazy: true,
|
|
|
columnBtn: false,
|
|
|
searchShow: true,
|
|
|
+ selection: true,
|
|
|
editBtn: true,
|
|
|
editBtnText: '资料管理',
|
|
|
editBtnIcon: 'Document',
|
|
|
@@ -162,7 +163,7 @@ export default {
|
|
|
align: 'center',
|
|
|
viewBtn: true,
|
|
|
viewBtnText: '详情',
|
|
|
- menuWidth: 320,
|
|
|
+ menuWidth: 380,
|
|
|
dialogClickModal: false,
|
|
|
column: [
|
|
|
{
|
|
|
@@ -194,16 +195,18 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '股(科)室',
|
|
|
- prop: 'createDeptName'
|
|
|
+ prop: 'createDeptName',
|
|
|
+ width: 180
|
|
|
},
|
|
|
{
|
|
|
label: '子项目数量',
|
|
|
- prop: 'lot'
|
|
|
+ prop: 'lot',
|
|
|
+ width: 180
|
|
|
},
|
|
|
{
|
|
|
label: '是否开工',
|
|
|
prop: 'isStart',
|
|
|
- width: 120,
|
|
|
+ width: 180,
|
|
|
dicData: [
|
|
|
{
|
|
|
label: '否',
|
|
|
@@ -218,11 +221,12 @@ export default {
|
|
|
{
|
|
|
label: '项目类型',
|
|
|
prop: 'projectTypeName',
|
|
|
- width: 120
|
|
|
+ width: 180
|
|
|
},
|
|
|
{
|
|
|
label: '创建时间',
|
|
|
- prop: 'createTime'
|
|
|
+ prop: 'createTime',
|
|
|
+ width: 180
|
|
|
}]
|
|
|
},
|
|
|
page: {
|
|
|
@@ -265,7 +269,7 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
- {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入项目名称', trigger: 'blur' }
|
|
|
],
|
|
|
projectType: [
|
|
|
{
|
|
|
@@ -286,27 +290,27 @@ export default {
|
|
|
parentId: 0
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.getTypeList()
|
|
|
this.$bus.on('serach', (res) => {
|
|
|
this.onLoad(res)
|
|
|
})
|
|
|
},
|
|
|
computed: {
|
|
|
- permissionList() {
|
|
|
+ permissionList () {
|
|
|
return {
|
|
|
delBtn: vaildData(this.permissions.permissions.home_del, false)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- switchTab(item, index) {
|
|
|
+ switchTab (item, index) {
|
|
|
this.active = index
|
|
|
this.onLoad()
|
|
|
},
|
|
|
- onLoad(query = {}) {
|
|
|
+ onLoad (query = {}) {
|
|
|
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.loading = false
|
|
|
if (res.code === 200) {
|
|
|
@@ -320,11 +324,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('功能建设中,尽情期待...', '消息提醒', {
|
|
|
@@ -332,51 +336,51 @@ 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
|
|
|
resolve(res.data.data.childrenList)
|
|
|
})
|
|
|
},
|
|
|
- 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)
|
|
|
+ }
|
|
|
})
|
|
|
+ })
|
|
|
},
|
|
|
- getStageList() {
|
|
|
+ getStageList () {
|
|
|
this.$api.project.userStageList().then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.stage = res.data
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getTotalAmount(data) {
|
|
|
+ getTotalAmount (data) {
|
|
|
this.$api.project.totalAmount(Object.assign(data, this.query)).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.num = res.data
|
|
|
@@ -385,17 +389,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
|
|
|
@@ -405,7 +409,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)
|
|
|
@@ -416,7 +420,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- projectSave() {
|
|
|
+ projectSave () {
|
|
|
if (this.disable) {
|
|
|
this.$message.error('正在处理,请稍后...')
|
|
|
return
|