|
@@ -89,11 +89,10 @@
|
|
|
</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('reimbursement:info:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
|
|
|
- <el-button v-if="hasPermission('reimbursement:info:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
|
|
|
- <el-button v-if="hasPermission('sys:project:exportFile')" type="warning" plain @click="exportFile()" size="small">导出</el-button>
|
|
|
+ <el-button v-if="hasPermission('cw:reimbursement:info:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
|
|
|
+ <el-button v-if="hasPermission('cw:reimbursement:info:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
|
|
|
</template>
|
|
|
</vxe-toolbar>
|
|
|
<div style="height: calc(100% - 80px)">
|
|
@@ -110,14 +109,22 @@
|
|
|
highlight-hover-row
|
|
|
:menu-config="{}"
|
|
|
:sort-config="{remote:true}"
|
|
|
+ :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']
|
|
|
+ }"
|
|
|
:data="dataList"
|
|
|
:checkbox-config="{}">
|
|
|
<vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
<vxe-column type="checkbox" width="40" ></vxe-column>
|
|
|
<vxe-column width="130" title="报销编号" field="no" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link type="primary" :underline="false" v-if="hasPermission('reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
|
|
|
- <el-link type="primary" :underline="false" v-else-if="hasPermission('reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('cw:reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" v-else-if="hasPermission('cw:reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
|
|
|
<span v-else>{{scope.row.no}}</span>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
@@ -129,14 +136,14 @@
|
|
|
<vxe-column width="130" title="报销类别" field="typeName"align="center"></vxe-column>
|
|
|
<vxe-column width="180" title="报销项目" field="projectName"align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link type="primary" :underline="false" v-if="hasPermission('reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.sourceType === '2' ? '' : scope.row.projectName}}</el-link>
|
|
|
- <el-link type="primary" :underline="false" v-else-if="hasPermission('reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.sourceType === '2' ? '' : scope.row.projectName}}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('cw:reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.sourceType === '2' ? '' : scope.row.projectName}}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" v-else-if="hasPermission('cw:reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.sourceType === '2' ? '' : scope.row.projectName}}</el-link>
|
|
|
<span v-else>{{scope.row.sourceType === '2' ? '' : scope.row.projectName}}</span>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column width="180" title="报销合同" field="projectName"align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link type="primary" :underline="false" v-if="hasPermission('reimbursement:info:view') && scope.row.projectId != undefined" @click="viewContract(scope.row.projectId)">{{scope.row.sourceType === '2' ? scope.row.projectName : ''}}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" v-if="hasPermission('cw:reimbursement:info:view') && scope.row.projectId != undefined" @click="viewContract(scope.row.projectId)">{{scope.row.sourceType === '2' ? scope.row.projectName : ''}}</el-link>
|
|
|
<span v-else>{{scope.row.sourceType === '2' ? scope.row.projectName : ''}}</span>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
@@ -154,9 +161,9 @@
|
|
|
|
|
|
<vxe-column title="操作" width="130px" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="hasPermission('reimbursement:info:edit') && scope.row.createId === $store.state.user.id && (scope.row.type === '1' || scope.row.type === '3' )" type="text" size="small" @click="edit(scope.row)">修改</el-button>
|
|
|
- <el-button v-if="hasPermission('reimbursement:info:edit') && scope.row.createId === $store.state.user.id && (scope.row.type === '2')" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
|
- <el-button v-if="hasPermission('reimbursement:info:del') && scope.row.createId === $store.state.user.id && (scope.row.type === '1')" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ <el-button v-if="hasPermission('cw:reimbursement:info:edit') && scope.row.createId === $store.state.user.id && (scope.row.type === '1' || scope.row.type === '3' )" type="text" size="small" @click="edit(scope.row)">修改</el-button>
|
|
|
+ <el-button v-if="hasPermission('cw:reimbursement:info:edit') && scope.row.createId === $store.state.user.id && (scope.row.type === '2')" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('cw:reimbursement:info:del') && scope.row.createId === $store.state.user.id && (scope.row.type === '1')" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -500,6 +507,31 @@
|
|
|
this.tablePage.currentPage = currentPage
|
|
|
this.tablePage.pageSize = pageSize
|
|
|
this.refreshList()
|
|
|
+ },
|
|
|
+ // 自定义服务端导出
|
|
|
+ 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.reimbursementApprovalService.exportFile(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(res.data, options.filename)
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|