|
@@ -1,5 +1,78 @@
|
|
|
<template>
|
|
|
<div class="el-scrollbar__wrap wrap-white padding-20">
|
|
|
+
|
|
|
+ <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
+
|
|
|
+ <el-form-item label="报销人员" prop="searchForm.userId">
|
|
|
+ <SelectUserTree
|
|
|
+ ref="companyTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+ :url="`/sys/user/treeUserDataAllOffice?type=2`"
|
|
|
+ :value="searchForm.userId"
|
|
|
+ :clearable="true"
|
|
|
+ :accordion="true"
|
|
|
+ :disabled="method==='edit'"
|
|
|
+ @getValue="(value) => {searchForm.userId=value}"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="实发类型" prop="searchForm.reimbursementFsalary">
|
|
|
+ <el-select v-model="searchForm.reimbursementFsalary" placeholder="请选择" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in this.$dictUtils.getDictList('reimbursement_fsalary')"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item
|
|
|
+ label="报销额度"
|
|
|
+ class="priceFormItem"
|
|
|
+ prop="income"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="searchForm.beginReimbursementQuota"
|
|
|
+ onkeyup="value=value.replace(/[^\d]/g,'')"
|
|
|
+ class="priceInput"
|
|
|
+ placeholder="起始金额"
|
|
|
+ style="width: 130px; margin-right: 10px"
|
|
|
+ />-<el-input
|
|
|
+ v-model="searchForm.endReimbursementQuota"
|
|
|
+ class="priceInput"
|
|
|
+ placeholder="结束金额"
|
|
|
+ onkeyup="value=value.replace(/[^\d]/g,'')"
|
|
|
+ style="width: 130px; margin-left: 10px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="报销时间" prop="makeTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="searchDates"
|
|
|
+ type="daterange"
|
|
|
+ size="small"
|
|
|
+ align="right"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
+ <el-button @click="exportUserBusinessExcel()" size="small" icon="el-icon-printer">导出</el-button>
|
|
|
+ <el-button type="info" size="small" @click="goBack">返回</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
<div class="el-scrollbar__view">
|
|
|
<el-row :gutter="20" v-loading="loading">
|
|
|
<el-col :span="12">
|
|
@@ -14,9 +87,6 @@
|
|
|
<span class="color: red">; 剩余报销额度:{{columnForm.surplusReimbursementAmount}}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" style="text-align:right">
|
|
|
- <el-button type="info" size="small" @click="goBack">返回</el-button>
|
|
|
- </el-col>
|
|
|
<el-table
|
|
|
:data="columnForm.columnList"
|
|
|
style="width: 100%">
|
|
@@ -75,9 +145,11 @@
|
|
|
|
|
|
<script>
|
|
|
import ReimbursementBusiness from '@/api/reimbursementSys/accountant/reimbursementBusinessService'
|
|
|
+ import SelectUserTree from './treeReimbursementBuinessUserSelect'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
+ searchDates: '',
|
|
|
title: '',
|
|
|
method: '',
|
|
|
loading: false,
|
|
@@ -92,11 +164,68 @@
|
|
|
sqlCmd: ''
|
|
|
},
|
|
|
columnForm: {
|
|
|
+ reimbursementQuotaDay: '', // 日报销额度
|
|
|
+ reimbursementDay: '', // 报销天数
|
|
|
+ alreadyReimbursementDay: '', // 已报销天数
|
|
|
+ surplusReimbursementDay: '', // 剩余报销天数
|
|
|
reimbursementQuota: '', // 报销额度
|
|
|
alreadyReimbursementAmount: '', // 已报销额度
|
|
|
surplusReimbursementAmount: '', // 剩余报销额度
|
|
|
+ reimbursementFsalary: '', // 报销来源
|
|
|
remarks: '', // 备注
|
|
|
+ businessCode: '', // 报销批次
|
|
|
+ year: '', // 年份
|
|
|
columnList: []
|
|
|
+ },
|
|
|
+ searchForm: {
|
|
|
+ id: '',
|
|
|
+ businessCodeId: '',
|
|
|
+ year: '',
|
|
|
+ beginDate: '',
|
|
|
+ endDate: '',
|
|
|
+ beginReimbursementQuota: '',
|
|
|
+ endReimbursementQuota: '',
|
|
|
+ reimbursementFsalary: '', // 实发类型
|
|
|
+ userId: '' // 报销人
|
|
|
+ },
|
|
|
+
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [{
|
|
|
+ text: '最近一周',
|
|
|
+ onClick (picker) {
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近一个月',
|
|
|
+ onClick (picker) {
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '最近三个月',
|
|
|
+ onClick (picker) {
|
|
|
+ const end = new Date()
|
|
|
+ const start = new Date()
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
|
+ picker.$emit('pick', [start, end])
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ searchDates () {
|
|
|
+ if (this.searchDates) {
|
|
|
+ this.searchForm.beginDate = this.searchDates[0]
|
|
|
+ this.searchForm.endDate = this.searchDates[1]
|
|
|
+ } else {
|
|
|
+ this.searchForm.beginDate = ''
|
|
|
+ this.searchForm.endDate = ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -107,20 +236,78 @@
|
|
|
activated () {
|
|
|
this.$refs['inputForm'].resetFields()
|
|
|
this.columnForm.columnList = []
|
|
|
- this.inputForm.id = this.$route.query.id
|
|
|
- if (this.inputForm.id) {
|
|
|
- this.reimbursementBusiness.findListByBusinessCodeId(this.inputForm.id).then(({data}) => {
|
|
|
+ this.searchForm.businessCodeId = this.$route.query.id
|
|
|
+ if (this.searchForm.businessCodeId) {
|
|
|
+ this.reimbursementBusiness.findListByBusinessCodeId(this.searchForm).then(({data}) => {
|
|
|
this.columnForm.columnList = data.list
|
|
|
+ this.columnForm.reimbursementDay = data.reimbursementDay
|
|
|
+ this.columnForm.alreadyReimbursementDay = data.alreadyReimbursementDay
|
|
|
+ this.columnForm.surplusReimbursementDay = data.surplusReimbursementDay
|
|
|
this.columnForm.reimbursementQuota = data.reimbursementQuota
|
|
|
this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
|
|
|
this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
|
|
|
+ this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
|
|
|
+ this.columnForm.businessCode = data.businessCode
|
|
|
+ this.columnForm.year = data.year
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ components: {
|
|
|
+ SelectUserTree
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 获取数据列表
|
|
|
+ refreshList () {
|
|
|
+ this.loading = true
|
|
|
+ this.reimbursementBusiness.findListByBusinessCodeId({
|
|
|
+ ...this.searchForm
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.columnForm.columnList = data.list
|
|
|
+ this.columnForm.reimbursementDay = data.reimbursementDay
|
|
|
+ this.columnForm.alreadyReimbursementDay = data.alreadyReimbursementDay
|
|
|
+ this.columnForm.surplusReimbursementDay = data.surplusReimbursementDay
|
|
|
+ this.columnForm.reimbursementQuota = data.reimbursementQuota
|
|
|
+ this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
|
|
|
+ this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
|
|
|
+ this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
|
|
|
+ this.columnForm.businessCode = data.businessCode
|
|
|
+ this.columnForm.year = data.year
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetSearch () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ this.searchForm.reimbursementFsalary = ''
|
|
|
+ this.searchForm.userId = ''
|
|
|
+ this.searchForm.beginReimbursementQuota = ''
|
|
|
+ this.searchForm.endReimbursementQuota = ''
|
|
|
+ this.searchDates = ''
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ },
|
|
|
goBack () {
|
|
|
this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
|
|
|
this.$router.push('/reimbursementSys/accountant/reimbursementList')
|
|
|
+ },
|
|
|
+ // 定义导出Excel表格事件
|
|
|
+ // 自定义服务端导出
|
|
|
+ exportUserBusinessExcel () {
|
|
|
+ // 传给服务端的参数
|
|
|
+ const params = {
|
|
|
+ ...this.searchForm,
|
|
|
+ filename: this.columnForm.year + '【' + this.columnForm.businessCode + '】报销批次' + '报销详情.xlsx',
|
|
|
+ sheetName: '业务报销详情'
|
|
|
+ }
|
|
|
+ return this.reimbursementBusiness.exportBusinessExcel(params).then((res) => {
|
|
|
+ // 将二进制流文件写入excel表,以下为重要步骤
|
|
|
+ this.$utils.downloadExcel(res.data, this.columnForm.year + '【' + this.columnForm.businessCode + '】报销批次' + '报销详情.xlsx')
|
|
|
+ }).catch(function (err) {
|
|
|
+ if (err.response) {
|
|
|
+ console.log(err.response)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|