Browse Source

报销详情、人员报销详情数据导出功能开发

user5 2 years ago
parent
commit
fef2cecf65
20 changed files with 20891 additions and 100 deletions
  1. 1 1
      .env.development
  2. 19723 22
      package-lock.json
  3. 12 2
      src/api/reimbursementSys/accountant/reimbursementBusinessService.js
  4. 9 0
      src/api/reimbursementSys/accountant/user/reimbursementUserService.js
  5. 11 2
      src/api/reimbursementSys/assess/reimbursementBusinessService.js
  6. 9 0
      src/api/reimbursementSys/assess/user/reimbursementUserService.js
  7. 11 2
      src/api/reimbursementSys/project/reimbursementBusinessService.js
  8. 9 0
      src/api/reimbursementSys/project/user/reimbursementUserService.js
  9. 11 2
      src/api/reimbursementSys/reimbursementBusinessService.js
  10. 9 0
      src/api/reimbursementSys/user/reimbursementUserService.js
  11. 11 2
      src/api/reimbursementSys/wuHanReimbursementBusinessService.js
  12. 193 6
      src/views/modules/reimbursementSys/accountant/reimbursementBusinessList.vue
  13. 30 1
      src/views/modules/reimbursementSys/accountant/user/reimbursementUserBusinessList.vue
  14. 194 6
      src/views/modules/reimbursementSys/assess/reimbursementBusinessList.vue
  15. 30 1
      src/views/modules/reimbursementSys/assess/user/reimbursementUserBusinessList.vue
  16. 193 6
      src/views/modules/reimbursementSys/project/reimbursementBusinessList.vue
  17. 30 1
      src/views/modules/reimbursementSys/project/user/reimbursementUserBusinessList.vue
  18. 195 6
      src/views/modules/reimbursementSys/reimbursementBusinessList.vue
  19. 16 34
      src/views/modules/reimbursementSys/user/reimbursementUserBusinessList.vue
  20. 194 6
      src/views/modules/reimbursementSys/wuHanReimbursementBusinessList.vue

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 VUE_APP_BASE_API = '/api'
 
 # Jeeplus快速开发平台/后台地址
-VUE_APP_SERVER_URL = 'http://localhost:8085'
+VUE_APP_SERVER_URL = 'http://localhost:8084'
 
 #单点登录设置
 VUE_APP_SSO_LOGIN  = 'false'

File diff suppressed because it is too large
+ 19723 - 22
package-lock.json


+ 12 - 2
src/api/reimbursementSys/accountant/reimbursementBusinessService.js

@@ -9,11 +9,12 @@ export default class reimbursementSys {
     })
   }
 
-  findListByBusinessCodeId (id) {
+  findListByBusinessCodeId (params) {
+    console.log(params)
     return request({
       url: '/accountant/reimbursementBusiness/findListByBusinessCodeId',
       method: 'get',
-      params: {id: id}
+      params: params
     })
   }
 
@@ -55,4 +56,13 @@ export default class reimbursementSys {
       params: params
     })
   }
+
+  exportBusinessExcel (params) {
+    return request({
+      url: '/accountant/reimbursementBusiness/exportBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 9 - 0
src/api/reimbursementSys/accountant/user/reimbursementUserService.js

@@ -80,4 +80,13 @@ export default class reimbursementSys {
       responseType: 'blob'
     })
   }
+
+  exportUserBusinessExcel (params) {
+    return request({
+      url: '/accountant/reimbursementUser/exportUserBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 11 - 2
src/api/reimbursementSys/assess/reimbursementBusinessService.js

@@ -9,11 +9,11 @@ export default class reimbursementSys {
     })
   }
 
-  findListByBusinessCodeId (id) {
+  findListByBusinessCodeId (params) {
     return request({
       url: '/assess/reimbursementBusiness/findListByBusinessCodeId',
       method: 'get',
-      params: {id: id}
+      params: params
     })
   }
 
@@ -55,4 +55,13 @@ export default class reimbursementSys {
       params: params
     })
   }
+
+  exportBusinessExcel (params) {
+    return request({
+      url: '/assess/reimbursementBusiness/exportBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 9 - 0
src/api/reimbursementSys/assess/user/reimbursementUserService.js

@@ -80,4 +80,13 @@ export default class reimbursementSys {
       responseType: 'blob'
     })
   }
+
+  exportUserBusinessExcel (params) {
+    return request({
+      url: '/assess/reimbursementUser/exportUserBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 11 - 2
src/api/reimbursementSys/project/reimbursementBusinessService.js

@@ -9,11 +9,11 @@ export default class reimbursementSys {
     })
   }
 
-  findListByBusinessCodeId (id) {
+  findListByBusinessCodeId (params) {
     return request({
       url: '/project/reimbursementBusiness/findListByBusinessCodeId',
       method: 'get',
-      params: {id: id}
+      params: params
     })
   }
 
@@ -55,4 +55,13 @@ export default class reimbursementSys {
       params: params
     })
   }
+
+  exportBusinessExcel (params) {
+    return request({
+      url: '/project/reimbursementBusiness/exportBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 9 - 0
src/api/reimbursementSys/project/user/reimbursementUserService.js

@@ -80,4 +80,13 @@ export default class reimbursementSys {
       responseType: 'blob'
     })
   }
+
+  exportUserBusinessExcel (params) {
+    return request({
+      url: '/project/reimbursementUser/exportUserBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 11 - 2
src/api/reimbursementSys/reimbursementBusinessService.js

@@ -9,11 +9,11 @@ export default class reimbursementSys {
     })
   }
 
-  findListByBusinessCodeId (id) {
+  findListByBusinessCodeId (params) {
     return request({
       url: '/reimbursementBusiness/findListByBusinessCodeId',
       method: 'get',
-      params: {id: id}
+      params: params
     })
   }
 
@@ -55,4 +55,13 @@ export default class reimbursementSys {
       params: params
     })
   }
+
+  exportBusinessExcel (params) {
+    return request({
+      url: '/reimbursementBusiness/exportBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 9 - 0
src/api/reimbursementSys/user/reimbursementUserService.js

@@ -80,4 +80,13 @@ export default class reimbursementSys {
       responseType: 'blob'
     })
   }
+
+  exportUserBusinessExcel (params) {
+    return request({
+      url: '/reimbursementUser/exportUserBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 11 - 2
src/api/reimbursementSys/wuHanReimbursementBusinessService.js

@@ -9,11 +9,11 @@ export default class reimbursementSys {
     })
   }
 
-  findListByBusinessCodeId (id) {
+  findListByBusinessCodeId (params) {
     return request({
       url: '/wuHanReimbursementBusiness/findListByBusinessCodeId',
       method: 'get',
-      params: {id: id}
+      params: params
     })
   }
 
@@ -55,4 +55,13 @@ export default class reimbursementSys {
       params: params
     })
   }
+
+  exportBusinessExcel (params) {
+    return request({
+      url: '/wuHanReimbursementBusiness/exportBusinessExcel',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
 }

+ 193 - 6
src/views/modules/reimbursementSys/accountant/reimbursementBusinessList.vue

@@ -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)
+          }
+        })
       }
     }
   }

+ 30 - 1
src/views/modules/reimbursementSys/accountant/user/reimbursementUserBusinessList.vue

@@ -73,6 +73,7 @@
       <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>
@@ -101,6 +102,11 @@
             :data="columnForm.columnList"
             style="width: 100%">
             <el-table-column
+              prop="userName"
+              label="报销人"
+            >
+            </el-table-column>
+            <el-table-column
               prop="businessCode"
               label="报销批次"
             >
@@ -200,6 +206,8 @@
           reimbursementFsalary: '',  // 实发类型
           officeType: '',  // 报销部门
           remarks: '',  // 备注
+          userName: '',  // 报销人名称
+          year: '',  // 年份
           columnList: []
         },
 
@@ -251,7 +259,6 @@
       this.$refs['inputForm'].resetFields()
       this.columnForm.columnList = []
       this.searchForm.userId = this.$route.query.userId
-      console.log(this.searchForm.userId)
       if (this.searchForm.userId) {
         this.reimbursementUser.findListByUserId(this.searchForm).then(({data}) => {
           this.columnForm.columnList = data.list
@@ -262,6 +269,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
         })
       }
     },
@@ -283,6 +292,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
           this.loading = false
         })
       },
@@ -312,6 +323,24 @@
         } else {
           return '——'
         }
+      },
+      // 定义导出Excel表格事件
+      // 自定义服务端导出
+      exportUserBusinessExcel () {
+        // 传给服务端的参数
+        const params = {
+          ...this.searchForm,
+          filename: this.columnForm.userName + this.columnForm.year + '报销详情.xlsx',
+          sheetName: '人员报销详情'
+        }
+        return this.reimbursementUser.exportUserBusinessExcel(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, this.columnForm.userName + this.columnForm.year + '报销详情.xlsx')
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
       }
     }
   }

+ 194 - 6
src/views/modules/reimbursementSys/assess/reimbursementBusinessList.vue

@@ -1,5 +1,79 @@
 <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 +88,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 +146,11 @@
 
 <script>
   import ReimbursementBusiness from '@/api/reimbursementSys/assess/reimbursementBusinessService'
+  import SelectUserTree from './treeReimbursementBuinessUserSelect'
   export default {
     data () {
       return {
+        searchDates: '',
         title: '',
         method: '',
         loading: false,
@@ -92,11 +165,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 +237,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/assess/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)
+          }
+        })
       }
     }
   }

+ 30 - 1
src/views/modules/reimbursementSys/assess/user/reimbursementUserBusinessList.vue

@@ -74,6 +74,7 @@
       <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>
@@ -102,6 +103,11 @@
             :data="columnForm.columnList"
             style="width: 100%">
             <el-table-column
+              prop="userName"
+              label="报销人"
+            >
+            </el-table-column>
+            <el-table-column
               prop="businessCode"
               label="报销批次"
             >
@@ -201,6 +207,8 @@
           reimbursementFsalary: '',  // 报销来源
           officeType: '',  // 报销部门
           remarks: '',  // 备注
+          userName: '',  // 报销人名称
+          year: '',  // 年份
           columnList: []
         },
 
@@ -252,7 +260,6 @@
       this.$refs['inputForm'].resetFields()
       this.columnForm.columnList = []
       this.searchForm.userId = this.$route.query.userId
-      console.log(this.searchForm.userId)
       if (this.searchForm.userId) {
         this.reimbursementUser.findListByUserId(this.searchForm).then(({data}) => {
           this.columnForm.columnList = data.list
@@ -263,6 +270,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
         })
       }
     },
@@ -284,6 +293,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
           this.loading = false
         })
       },
@@ -313,6 +324,24 @@
         } else {
           return '——'
         }
+      },
+      // 定义导出Excel表格事件
+      // 自定义服务端导出
+      exportUserBusinessExcel () {
+        // 传给服务端的参数
+        const params = {
+          ...this.searchForm,
+          filename: this.columnForm.userName + this.columnForm.year + '报销详情.xlsx',
+          sheetName: '人员报销详情'
+        }
+        return this.reimbursementUser.exportUserBusinessExcel(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, this.columnForm.userName + this.columnForm.year + '报销详情.xlsx')
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
       }
     }
   }

+ 193 - 6
src/views/modules/reimbursementSys/project/reimbursementBusinessList.vue

@@ -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/project/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/project/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)
+          }
+        })
       }
     }
   }

+ 30 - 1
src/views/modules/reimbursementSys/project/user/reimbursementUserBusinessList.vue

@@ -73,6 +73,7 @@
       <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>
@@ -101,6 +102,11 @@
             :data="columnForm.columnList"
             style="width: 100%">
             <el-table-column
+              prop="userName"
+              label="报销人"
+            >
+            </el-table-column>
+            <el-table-column
               prop="businessCode"
               label="报销批次"
             >
@@ -200,6 +206,8 @@
           reimbursementFsalary: '',  // 实发类型
           officeType: '',  // 报销部门
           remarks: '',  // 备注
+          userName: '',  // 报销人名称
+          year: '',  // 年份
           columnList: []
         },
 
@@ -251,7 +259,6 @@
       this.$refs['inputForm'].resetFields()
       this.columnForm.columnList = []
       this.searchForm.userId = this.$route.query.userId
-      console.log(this.searchForm.userId)
       if (this.searchForm.userId) {
         this.reimbursementUser.findListByUserId(this.searchForm).then(({data}) => {
           this.columnForm.columnList = data.list
@@ -262,6 +269,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
         })
       }
     },
@@ -283,6 +292,8 @@
           this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
           this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
           this.columnForm.reimbursementQuotaDay = data.reimbursementQuotaDay
+          this.columnForm.userName = data.userName
+          this.columnForm.year = data.year
           this.loading = false
         })
       },
@@ -312,6 +323,24 @@
         } else {
           return '——'
         }
+      },
+      // 定义导出Excel表格事件
+      // 自定义服务端导出
+      exportUserBusinessExcel () {
+        // 传给服务端的参数
+        const params = {
+          ...this.searchForm,
+          filename: this.columnForm.userName + this.columnForm.year + '报销详情.xlsx',
+          sheetName: '人员报销详情'
+        }
+        return this.reimbursementUser.exportUserBusinessExcel(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, this.columnForm.userName + this.columnForm.year + '报销详情.xlsx')
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
       }
     }
   }

+ 195 - 6
src/views/modules/reimbursementSys/reimbursementBusinessList.vue

@@ -1,5 +1,79 @@
 <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 +88,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 +146,11 @@
 
 <script>
   import ReimbursementBusiness from '@/api/reimbursementSys/reimbursementBusinessService'
+  import SelectUserTree from './treeReimbursementBuinessUserSelect'
   export default {
     data () {
       return {
+        searchDates: '',
         title: '',
         method: '',
         loading: false,
@@ -92,10 +165,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 = ''
         }
       }
     },
@@ -106,20 +237,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/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)
+          }
+        })
       }
     }
   }

+ 16 - 34
src/views/modules/reimbursementSys/user/reimbursementUserBusinessList.vue

@@ -73,7 +73,7 @@
       <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="exportExcel()" size="small" icon="el-icon-printer">导出</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>
@@ -114,11 +114,6 @@
             >
             </el-table-column>
             <el-table-column
-              prop="reimbursementBatch"
-              label="业务编号"
-            >
-            </el-table-column>
-            <el-table-column
               prop="year"
               label="报销年份"
             >
@@ -177,8 +172,6 @@
 
 <script>
   import ReimbursementUser from '@/api/reimbursementSys/user/reimbursementUserService'
-  import FileSaver from 'file-saver'
-  import * as XLSX from 'xlsx'
 
   export default {
     data () {
@@ -337,33 +330,22 @@
         }
       },
       // 定义导出Excel表格事件
-      exportExcel () {
-        var xlsxParam = { raw: true }
-        /* 从表生成工作簿对象 */
-        var wb = XLSX.utils.table_to_book(
-          document.querySelector('#out-table'),
-          xlsxParam
-        )
-        /* 获取二进制字符串作为输出 */
-        var wbout = XLSX.write(wb, {
-          bookType: 'xlsx',
-          bookSST: true,
-          type: 'array'
-        })
-        try {
-          FileSaver.saveAs(
-            // Blob 对象表示一个不可变、原始数据的类文件对象。
-            // Blob 表示的不一定是JavaScript原生格式的数据。
-            // File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
-            // 返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
-            new Blob([wbout], { type: 'application/octet-stream' }),
-            // 设置导出文件名称
-            this.columnForm.userName + this.columnForm.year + '报销详情.xlsx'
-          )
-        } catch (e) {
-          if (typeof console !== 'undefined') console.log(e, wbout)
+      // 自定义服务端导出
+      exportUserBusinessExcel () {
+        // 传给服务端的参数
+        const params = {
+          ...this.searchForm,
+          filename: this.columnForm.userName + this.columnForm.year + '报销详情.xlsx',
+          sheetName: '人员报销详情'
         }
-        return wbout
+        return this.reimbursementUser.exportUserBusinessExcel(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, this.columnForm.userName + this.columnForm.year + '报销详情.xlsx')
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
       }
     }
   }

+ 194 - 6
src/views/modules/reimbursementSys/wuHanReimbursementBusinessList.vue

@@ -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/wuHanReimbursementBusinessService'
+  import SelectUserTree from './treeReimbursementBuinessUserSelect'
   export default {
     data () {
       return {
+        searchDates: '',
         title: '',
         method: '',
         loading: false,
@@ -92,10 +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 = ''
         }
       }
     },
@@ -106,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/wuHanReimbursementList')
+      },
+      // 定义导出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)
+          }
+        })
       }
     }
   }