|
|
@@ -83,7 +83,7 @@
|
|
|
</el-form>
|
|
|
|
|
|
<div class="jp-table">
|
|
|
- <vxe-toolbar ref="toolbarRef" :refresh="{ query: refreshList }" custom>
|
|
|
+ <vxe-toolbar ref="toolbarRef" :refresh="{ query: refreshList }" export custom>
|
|
|
<template #buttons>
|
|
|
<el-button v-if="hasPermission('sys:project:add')" type="primary" icon="el-icon-plus"
|
|
|
@click="add()">新建</el-button>
|
|
|
@@ -93,7 +93,14 @@
|
|
|
<vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
|
|
|
ref="workContractTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
|
|
|
:print-config="{}" @sort-change="sortChangeHandle" :sort-config="{ remote: true }" :data="dataList"
|
|
|
- :checkbox-config="{}" :tooltip-config="tooltipConfig">
|
|
|
+ :checkbox-config="{}" :tooltip-config="tooltipConfig" :export-config="{
|
|
|
+ remote: true,
|
|
|
+ filename: `兴光评估合同数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ sheetName: `兴光评估合同数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ exportMethod: exportMethod,
|
|
|
+ types: ['xls'],
|
|
|
+ modes: ['current', 'selected', 'all']
|
|
|
+ }">
|
|
|
<vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
<vxe-column type="checkbox" width="50px"></vxe-column>
|
|
|
|
|
|
@@ -124,7 +131,7 @@
|
|
|
<div>
|
|
|
<!-- 把字符串用 split(',') 转成数组直接循环 -->
|
|
|
<template v-for="(item, index) in (scope.row.reportNos || '').split(',')">
|
|
|
- <el-tag type="primary" v-if="item.trim()" :key="index" style="margin-right: 4px;">
|
|
|
+ <el-tag type="primary" v-if="item.trim()" :key="index" style="margin-right: 4px; cursor: pointer;" @click="viewProjectByReportNo(item.trim())">
|
|
|
{{ item.trim() }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
@@ -277,6 +284,7 @@
|
|
|
<WorkContractBorrowMessageForm ref="workContractBorrowMessageForm" @refreshDataList="refreshList">
|
|
|
</WorkContractBorrowMessageForm>
|
|
|
<user-select ref="userSelect2" @doSubmit="selectUser"></user-select>
|
|
|
+ <ProjectForm ref="projectForm"></ProjectForm>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -295,6 +303,7 @@ import pick from 'lodash.pick'
|
|
|
import userService from '@/api/sys/userService'
|
|
|
// import UserSelect from '@/components/userSelect'
|
|
|
import UserSelect from '@/views/utils/UserTreeSelect'
|
|
|
+import ProjectForm from '@/views/program/registered/ProjectForm'
|
|
|
export default {
|
|
|
data() {
|
|
|
const tooltipConfig = {
|
|
|
@@ -370,7 +379,16 @@ export default {
|
|
|
WorkClientForm,
|
|
|
WorkContractBorrowMessageForm,
|
|
|
SelectUserTree,
|
|
|
- UserSelect
|
|
|
+ UserSelect,
|
|
|
+ ProjectForm
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 将表格和工具栏进行关联
|
|
|
+ const $table = this.$refs.workContractTable;
|
|
|
+ const $toolbar = this.$refs.toolbarRef;
|
|
|
+ $table.connect($toolbar);
|
|
|
+ });
|
|
|
},
|
|
|
activated() {
|
|
|
this.is()
|
|
|
@@ -439,6 +457,32 @@ export default {
|
|
|
}
|
|
|
this.refreshList()
|
|
|
},
|
|
|
+ // 自定义服务端导出
|
|
|
+ exportMethod({ options }) {
|
|
|
+ // 传给服务端的参数
|
|
|
+ const params = {
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ 'itemType': '1',
|
|
|
+ ...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.workContractService.exportFile(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表
|
|
|
+ this.$utils.downloadExcel(res, options.filename + '.xls')
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 新增
|
|
|
add() {
|
|
|
this.start()
|
|
|
@@ -481,6 +525,16 @@ export default {
|
|
|
viewInfo(id) {
|
|
|
this.$refs.workClientForm.init('view', id)
|
|
|
},
|
|
|
+ // 根据报告号查看项目信息
|
|
|
+ viewProjectByReportNo(reportNo) {
|
|
|
+ this.workContractService.getProjectIdByReportNo(reportNo).then((projectId) => {
|
|
|
+ if (projectId) {
|
|
|
+ this.$refs.projectForm.init('view', projectId)
|
|
|
+ } else {
|
|
|
+ this.$message.warning('未找到该项目信息')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除
|
|
|
del(id) {
|
|
|
let ids = id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
|