|
@@ -18,6 +18,21 @@
|
|
|
@getValue="(value) => {searchForm.userId=value}"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item prop="officeId" :rules=" [{trigger: 'blur'}]" label="部门">
|
|
|
+ <SelectUserTree
|
|
|
+ ref="companyTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+ :url="`/sys/user/treeUserDataByOfficeList?type=2&officeName=兴光会计`"
|
|
|
+ :value="searchForm.officeId"
|
|
|
+ :clearable="true"
|
|
|
+ :accordion="true"
|
|
|
+ @getValue="(value) => {searchForm.officeId=value}"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="年份" prop="year":rules="[{trigger:'blur'}]">
|
|
|
<el-date-picker
|
|
|
v-model="searchForm.year"
|
|
@@ -60,7 +75,14 @@
|
|
|
importMethod: importMethod,
|
|
|
types: ['xls', 'xlsx'],
|
|
|
remote: true}"
|
|
|
- :export-config="{}"
|
|
|
+ :export-config="{
|
|
|
+ remote: true,
|
|
|
+ filename: `兴光会计报销人员信息数据${moment(new Date()).format('YYYY-MM-DD')}`,
|
|
|
+ sheetName: '兴光会计报销人员信息数据',
|
|
|
+ exportMethod: exportMethod,
|
|
|
+ types: ['xlsx'],
|
|
|
+ modes: ['current', 'selected', 'all']
|
|
|
+ }"
|
|
|
@sort-change="sortChangeHandle"
|
|
|
:sort-config="{remote:true}"
|
|
|
:data="dataList"
|
|
@@ -119,6 +141,7 @@ export default {
|
|
|
dataList: [],
|
|
|
searchForm: {
|
|
|
year: '',
|
|
|
+ officeId: '',
|
|
|
userId: ''
|
|
|
},
|
|
|
tablePage: {
|
|
@@ -255,6 +278,31 @@ export default {
|
|
|
})
|
|
|
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.reimbursementUser.exportExcel(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(res.data, options.filename)
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|