|
@@ -12,7 +12,8 @@
|
|
|
<el-input size="small" v-model="searchForm.cwProjectRecordsDTO.projectName" placeholder="请输入项目名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目经理" prop="cwProjectRecordsDTO.projectMasterName">
|
|
|
- <el-input size="small" v-model="searchForm.cwProjectRecordsDTO.projectMasterName" placeholder="请输入项目经理" clearable></el-input>
|
|
|
+<!-- <el-input size="small" v-model="searchForm.cwProjectRecordsDTO.projectMasterName" placeholder="请输入项目经理" clearable></el-input>-->
|
|
|
+ <UserSelect :limit='1' :userName="searchForm.cwProjectRecordsDTO.projectMasterName" @getValue='(value, label) => {searchForm.cwProjectRecordsDTO.projectMasterName = label}'></UserSelect>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="档案年度" prop="year">
|
|
|
<el-date-picker
|
|
@@ -53,7 +54,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="创建人" prop="createBy.name">
|
|
|
- <el-input size="small" v-model="searchForm.createBy.name" placeholder="请输入创建人" clearable></el-input>
|
|
|
+<!-- <el-input size="small" v-model="searchForm.createBy.name" placeholder="请输入创建人" clearable></el-input>-->
|
|
|
+ <UserSelect :limit='1' :userName="searchForm.createBy.name" @getValue='(value, label) => {searchForm.createBy.name = label}'></UserSelect>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="创建时间" prop="createDates">
|
|
|
<el-date-picker
|
|
@@ -78,7 +80,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="bg-white top" style="">
|
|
|
- <vxe-toolbar :refresh="{query: refreshList}" custom>
|
|
|
+ <vxe-toolbar :refresh="{query: refreshList}" export custom>
|
|
|
<template #buttons>
|
|
|
<el-button v-if="hasPermission('cwProjectReportArchive:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
|
|
|
</template>
|
|
@@ -95,6 +97,14 @@
|
|
|
ref="projectTable"
|
|
|
show-header-overflow
|
|
|
show-overflow
|
|
|
+ :export-config="{
|
|
|
+ remote: true,
|
|
|
+ filename: `报告归档数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ sheetName: `报告归档数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ exportMethod: exportMethod,
|
|
|
+ types: ['xlsx'],
|
|
|
+ modes: ['current', 'selected', 'all']
|
|
|
+ }"
|
|
|
highlight-hover-row
|
|
|
:menu-config="{}"
|
|
|
@sort-change="sortChangeHandle"
|
|
@@ -102,6 +112,7 @@
|
|
|
:data="dataList"
|
|
|
:checkbox-config="{}">
|
|
|
<vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
+ <vxe-column type="checkbox" width="40" ></vxe-column>
|
|
|
<vxe-column min-width="230" align="center" title="档案名称" field="name">
|
|
|
<template slot-scope="scope">
|
|
|
<el-link type="primary" :underline="false" v-if="hasPermission('cwProjectReportArchive:view')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
|
|
@@ -134,11 +145,11 @@
|
|
|
</vxe-column>
|
|
|
<vxe-column title="操作" width="150px" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="hasPermission('cwProjectReportArchive:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text" icon="el-icon-edit" size="small" @click="push(scope.row)">修改</el-button>
|
|
|
- <el-button v-else-if="hasPermission('cwProjectReportArchive:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
|
|
|
- <el-button v-if="hasPermission('cwProjectReportArchive:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
|
- <el-button v-if="hasPermission('cwProjectReportArchive:del')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
- <el-button v-else-if="hasPermission('cwProjectReportArchive:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ <el-button v-if="hasPermission('cwProjectReportArchive:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text" size="small" @click="push(scope.row)">修改</el-button>
|
|
|
+ <el-button v-else-if="hasPermission('cwProjectReportArchive:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
|
|
|
+ <el-button v-if="hasPermission('cwProjectReportArchive:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('cwProjectReportArchive:del')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ <el-button v-else-if="hasPermission('cwProjectReportArchive:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -167,6 +178,7 @@
|
|
|
import UserService from '@/api/sys/UserService'
|
|
|
import ProjectRecordsForm from '../projectRecords/ProjectRecordsForm'
|
|
|
import ProjectReportArchiveForm from './ProjectReportArchiveForm'
|
|
|
+ import UserSelect from '@/components/userSelect'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -213,7 +225,8 @@
|
|
|
},
|
|
|
components: {
|
|
|
ProjectRecordsForm,
|
|
|
- ProjectReportArchiveForm
|
|
|
+ ProjectReportArchiveForm,
|
|
|
+ UserSelect
|
|
|
},
|
|
|
computed: {
|
|
|
userName () {
|
|
@@ -266,7 +279,7 @@
|
|
|
}).then(({data}) => {
|
|
|
this.dataList = data.records
|
|
|
this.tablePage.total = data.total
|
|
|
- this.tableKey = Math.random()
|
|
|
+ // this.tableKey = Math.random()
|
|
|
this.loading = false
|
|
|
})
|
|
|
this.checkIsAdmin()
|
|
@@ -410,6 +423,31 @@
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ // 自定义服务端导出
|
|
|
+ exportMethod ({ options }) {
|
|
|
+ // 传给服务端的参数
|
|
|
+ const params = {
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ ...this.searchForm,
|
|
|
+ filename: options.filename,
|
|
|
+ sheetName: options.sheetName,
|
|
|
+ isHeader: options.isHeader,
|
|
|
+ original: options.original,
|
|
|
+ mode: options.mode,
|
|
|
+ selectIds: options.mode === 'selected' ? options.data.map(item => item.id) : [],
|
|
|
+ exportFields: options.columns.map(column => column.property)
|
|
|
+ }
|
|
|
+ return this.projectReportArchiveService.exportFile(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(res.data, options.filename)
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|