Browse Source

中审报表报销以及报销数据查询功能开发

user5 3 years ago
parent
commit
ebaa51aa77

+ 58 - 0
src/api/reimbursementSys/reimbursementBusinessService.js

@@ -0,0 +1,58 @@
+import request from '@/utils/httpRequest'
+
+export default class reimbursementSys {
+  findList (params) {
+    return request({
+      url: '/reimbursementBusiness/findList',
+      method: 'get',
+      params: params
+    })
+  }
+
+  findListByBusinessCodeId (id) {
+    return request({
+      url: '/reimbursementBusiness/findListByBusinessCodeId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+
+  save (inputForm) {
+    return request({
+      url: `/reimbursementBusiness/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  delete (ids) {
+    return request({
+      url: '/reimbursementUser/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+
+  queryById (id) {
+    return request({
+      url: `/reimbursementUser/queryById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+
+  getBusinessById (id) {
+    return request({
+      url: `/reimbursementBusiness/getBusinessById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  yearList (params) {
+    return request({
+      url: '/reimbursementBusiness/getYearList',
+      method: 'get',
+      params: params
+    })
+  }
+}

+ 8 - 0
src/api/reimbursementSys/reimbursementSysService.js

@@ -17,6 +17,14 @@ export default class reimbursementSys {
     })
     })
   }
   }
 
 
+  updateReimbursementRatio (inputForm) {
+    return request({
+      url: `/reimbursement/updateReimbursementRatio`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
   saveInvoice (inputForm) {
   saveInvoice (inputForm) {
     return request({
     return request({
       url: `/reimbursement/saveInvoice`,
       url: `/reimbursement/saveInvoice`,

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

@@ -0,0 +1,43 @@
+import request from '@/utils/httpRequest'
+
+export default class reimbursementSys {
+  findList (params) {
+    return request({
+      url: '/reimbursementUser/findList',
+      method: 'get',
+      params: params
+    })
+  }
+
+  save (inputForm) {
+    return request({
+      url: `/reimbursementUser/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  delete (ids) {
+    return request({
+      url: '/reimbursementUser/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+
+  queryById (id) {
+    return request({
+      url: `/reimbursementUser/queryById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+
+  findListByUserId (id) {
+    return request({
+      url: `/reimbursementUser/findListByUserId`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 2 - 2
src/components/treeSelect/treeSelect.vue

@@ -8,7 +8,7 @@
         :show-checkbox="showCheckbox"
         :show-checkbox="showCheckbox"
         :props="props"
         :props="props"
         highlight-current
         highlight-current
-        :node-key="props.value"    
+        :node-key="props.value"
         :default-expanded-keys="defaultExpandedKey"
         :default-expanded-keys="defaultExpandedKey"
         @check-change="handleCheckChange"
         @check-change="handleCheckChange"
         @node-click="handleNodeClick">
         @node-click="handleNodeClick">
@@ -285,4 +285,4 @@ export default {
   .el-tree-node__content:hover{
   .el-tree-node__content:hover{
     background-color: #f5f7fa;
     background-color: #f5f7fa;
   } */
   } */
-</style>
+</style>

+ 288 - 0
src/components/treeSelect/treeUserSelect.vue

@@ -0,0 +1,288 @@
+<template>
+  <el-select :value="valueTitle" :size="size"  :disabled="disabled" :clearable="clearable" :placeholder="placeholderText" @clear="clearHandle">
+    <el-option :value="valueTitle"  :label="valueTitle" class="options">
+      <el-tree  id="tree-option"
+        ref="selectTree"
+        :accordion="accordion"
+        :data="optionData"
+        :show-checkbox="showCheckbox"
+        :props="props"
+        highlight-current
+        :node-key="props.value"
+        :default-expanded-keys="defaultExpandedKey"
+        @check-change="handleCheckChange"
+        @node-click="handleNodeClick">
+      </el-tree>
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+export default {
+  name: 'el-tree-select',
+  props: {
+    /* 配置项 */
+    props: {
+      type: Object,
+      default: () => {
+        return {
+          value: 'id',             // ID字段名
+          label: 'label',         // 显示名称
+          children: 'children'    // 子级字段名
+        }
+      }
+    },
+    /* 选项列表数据(树形结构的对象数组) */
+    data: {
+      type: Array,
+      default: () => { return [] }
+    },
+     /* 选项列表数据(树形结构的对象数组) */
+    list: {
+      type: Array,
+      default: () => { return null }
+    },
+    /* 初始值 */
+    value: {
+      type: String,
+      default: () => { return null }
+    },
+        /* 初始值 */
+    url: {
+      type: String,
+      default: () => { return null }
+    },
+    disabled: {
+      type: Boolean,
+      dafault: () => { return false }
+    },
+    showCheckbox: {
+      type: Boolean,
+      dafault: () => { return false }
+    },
+    /* 初始值 */
+    label: {
+      type: String,
+      default: () => { return null }
+    },
+    /* 可清空选项 */
+    clearable: {
+      type: Boolean,
+      default: () => { return true }
+    },
+    /* 自动收起 */
+    accordion: {
+      type: Boolean,
+      default: () => { return false }
+    },
+    size: {
+      type: String,
+      default: () => { return 'small' }
+    },
+    placeholder: {
+      type: String,
+      default: () => { return '请选择' }
+    },
+    isOnlySelectLeaf: {
+      type: Boolean,
+      default: () => {
+        return false
+      }
+    }
+  },
+  data () {
+    return {
+      valueId: this.value,    // 初始值
+      valueTitle: this.label,
+      defaultExpandedKey: [],
+      placeholderText: this.placeholder,
+      treeList: [],
+      valueData: this.data
+    }
+  },
+  created () {
+    if (this.url !== null) {
+      this.placeholderText = '加载数据中...'
+      let interval = setInterval(() => {
+        this.placeholderText = this.placeholderText + '.'
+      }, 500)
+      this.$http({
+        url: this.url,
+        method: 'get'
+      }).then(({data}) => {
+        this.valueData = data
+        this.setTreeList(this.valueData)
+        this.$nextTick(() => {
+          this.initHandle()
+          this.placeholderText = this.placeholder
+          clearInterval(interval)
+        })
+      })
+    } else {
+      this.valueData = this.data
+      this.setTreeList(this.valueData)
+    }
+  },
+  methods: {
+    setTreeList (datas) { // 遍历树  获取id数组
+      for (var i in datas) {
+        this.treeList.push(datas[i])
+        if (datas[i].children) {
+          this.setTreeList(datas[i].children)
+        }
+      }
+    },
+    // 初始化值
+    initHandle () {
+      if (this.valueId) {
+        if (this.showCheckbox) {
+          let ids = this.valueId.split(',')
+          this.$refs.selectTree.setCheckedKeys(ids)
+          let titles = []
+          ids.forEach((id) => {
+            this.treeList.forEach((d) => {
+              if (id === d[this.props.value]) {
+                titles.push(d[this.props.label])
+              }
+            })
+          })
+
+          this.valueTitle = titles.join(',')
+        } else if (this.$refs.selectTree.getNode(this.valueId)) {
+          this.valueTitle = this.$refs.selectTree.getNode(this.valueId).data[this.props.label]     // 初始化显示
+          this.$refs.selectTree.setCurrentKey(this.valueId)       // 设置默认选中
+          this.defaultExpandedKey = [this.valueId]      // 设置默认展开
+        }
+      }
+      this.initScroll()
+    },
+    getNode (id) {
+      return this.$refs.selectTree.getNode(id)
+    },
+    // 初始化滚动条
+    initScroll () {
+      this.$nextTick(() => {
+        let scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0]
+        let scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar')
+        if (scrollWrap) { scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;' }
+        if (scrollBar) {
+          scrollBar.forEach(ele => {
+          // eslint-disable-next-line no-return-assign
+            return ele.style.width = 0
+          })
+        }
+      })
+    },
+    // 切换选项
+    handleNodeClick (node) {
+      if (this.showCheckbox) {
+        return
+      }
+      if (node['disabled'] || node['typeFlag']) {
+        this.$message.warning('节点(' + node[this.props.label] + ')被禁止选择,请重新选择。')
+        return
+      }
+      if (this.isOnlySelectLeaf && node.children.length > 0) {
+        this.$message.warning('不能选择根节点(' + node[this.props.label] + ')请重新选择。')
+        return
+      }
+      this.valueTitle = node[this.props.label]
+      this.valueId = node[this.props.value]
+      this.$emit('getValue', this.valueId, this.valueTitle, node)
+    },
+    handleCheckChange (data, checked, indeterminate) {
+      let nodes = this.$refs.selectTree.getCheckedNodes()
+      this.valueTitle = nodes.map((node) => {
+        return node[this.props.label]
+      }).join(',')
+      this.valueId = nodes.map((node) => {
+        return node[this.props.value]
+      }).join(',')
+      this.$emit('getValue', this.valueId, this.valueTitle)
+    },
+    // 清除选中
+    clearHandle () {
+      this.valueTitle = ''
+      this.valueId = null
+      this.defaultExpandedKey = []
+      this.clearSelected()
+      this.$emit('getValue', null, null, null)
+    },
+    /* 清空选中样式 */
+    clearSelected () {
+      let allNode = document.querySelectorAll('#tree-option .el-tree-node')
+      allNode.forEach((element) => element.classList.remove('is-current'))
+    }
+  },
+  watch: {
+    value () {
+      this.valueId = this.value
+      if (this.value === '' || this.value === null || this.value === undefined) {
+        this.clearHandle()
+      } else {
+        this.initHandle()
+      }
+    },
+    data () {
+      this.valueData = this.data
+    }
+  },
+  computed: {
+    optionData () {
+      if (this.list) {
+        let cloneData = JSON.parse(JSON.stringify(this.list))      // 对源数据深度克隆
+        return cloneData.filter(father => {                      // 循环所有项,并添加children属性
+          let branchArr = cloneData.filter(child => father.id === child.parentId)       // 返回每一项的子级数组
+            // eslint-disable-next-line no-unused-expressions
+          branchArr.length > 0 ? father.children = branchArr : ''   // 给父级添加一个children属性,并赋值
+          return father.parentId === '0'      // 返回第一层
+        })
+      } else {
+        return this.valueData
+      }
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+  .el-select{
+    width: 100%;
+  }
+  .el-scrollbar .el-scrollbar__view .el-select-dropdown__item{
+    height: auto;
+    max-height: 274px;
+    padding: 0;
+    overflow: hidden;
+    overflow-y: auto;
+  }
+  .el-select-dropdown__item.selected{
+    font-weight: normal;
+  }
+  ul li >>>.el-tree .el-tree-node__content{
+    height:auto;
+    padding: 0 20px;
+  }
+  .el-tree-node__label{
+    font-weight: normal;
+  }
+  .el-tree >>>.is-current .el-tree-node__label{
+    color: #409EFF;
+    font-weight: 700;
+  }
+  .el-tree >>>.is-current .el-tree-node__children .el-tree-node__label{
+    color:#606266;
+    font-weight: normal;
+  }
+  /* 开发禁用 */
+  /* .el-tree-node:focus>.el-tree-node__content{
+    background-color:transparent;
+    background-color: #f5f7fa;
+    color: #c0c4cc;
+    cursor: not-allowed;
+  }
+  .el-tree-node__content:hover{
+    background-color: #f5f7fa;
+  } */
+</style>

+ 2 - 2
src/views/modules/database/datamodel/DataSetForm.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 <div class="el-scrollbar__wrap wrap-white padding-20">
 <div class="el-scrollbar__wrap wrap-white padding-20">
-  <div class="el-scrollbar__view">    
+  <div class="el-scrollbar__view">
       <el-row :gutter="20" v-loading="loading">
       <el-row :gutter="20" v-loading="loading">
         <el-col :span="24">
         <el-col :span="24">
            <el-row :gutter="20">
            <el-row :gutter="20">
@@ -333,4 +333,4 @@
       }
       }
     }
     }
   }
   }
-</script>
+</script>

+ 1 - 1
src/views/modules/database/datamodel/DataSetList.vue

@@ -232,4 +232,4 @@
       }
       }
     }
     }
   }
   }
-</script>
+</script>

+ 252 - 0
src/views/modules/reimbursementSys/reimbursementBusinessForm.vue

@@ -0,0 +1,252 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+    v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="120px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item prop="userId" :rules=" [{required: true, message: '人员不能为空', trigger: 'blur'}]" label="人员">
+            <SelectUserTree
+              ref="companyTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              :url="`/sys/user/treeUserData?type=2`"
+              :value="inputForm.userId"
+              :clearable="true"
+              :accordion="true"
+              :disabled="method==='edit'"
+              @getValue="(value) => {inputForm.userId=value}"/>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="年份" prop="year" :rules="[{required: true, message: '年份不能为空', trigger: 'blur'}]">
+            <el-select v-model="inputForm.year" @change="selectYear(inputForm.year)" style="width:100%" placeholder="请选择">
+              <el-option
+                v-for="year in yearList"
+                :key="year.id"
+                :label="year.year"
+                :value="year.year">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="报销天数" prop="reimbursementDay" :rules="[{required: true, max: 10, message:'报销天数不能为空且只可为整数', trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementDay" class="bg-grey" size="small" placeholder="报销天数" style="width: 100%;" @keyup.native="inputForm.reimbursementDay = checkInputs(inputForm.reimbursementDay)"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="报销金额" prop="reimbursementAmount":rules="[{max: 10,trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementAmount" class="bg-grey" size="small" placeholder="报销金额" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="日报销额度" prop="reimbursementQuotaDay":rules="[{max: 10,trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementQuotaDay" class="bg-grey" size="small" placeholder="日报销额度" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="年报销额度" prop="reimbursementQuota":rules="[{max: 10,trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementQuota" class="bg-grey" size="small" placeholder="年报销额度" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="剩余可报额度" prop="remainReimbursementAmount" :rules="[{max: 10, trigger:'blur'}]">
+            <el-input v-model="inputForm.remainReimbursementAmount" class="bg-grey" size="small" placeholder="剩余可报额度" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="业务可报额度" prop="canReimbursementAmount" :rules="[{max: 10, trigger:'blur'}]">
+            <el-input v-model="inputForm.canReimbursementAmount" class="bg-grey" size="small" placeholder="业务可报额度" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="业务剩余可报额度" prop="surplusReimbursementAmount" :rules="[{max: 10, trigger:'blur'}]">
+            <el-input v-model="inputForm.surplusReimbursementAmount" class="bg-grey" size="small" placeholder="业务剩余可报额度" style="width: 100%;" :disabled="true">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import SelectUserTree from './treeReimbursementBuinessUserSelect'
+  import ReimbursementBusiness from '@/api/reimbursementSys/reimbursementBusinessService'
+  export default {
+    data () {
+      return {
+        visible: false,
+        loading: false,
+        title: '',
+        method: '',
+        yearList: [],
+        inputForm: {
+          id: '',
+          userId: '', // 人员id
+          year: '', // 年份
+          reimbursementQuota: '', // 年报销额度
+          reimbursementAmount: '', // 报销金额
+          reimbursementQuotaDay: '', // 日报销额度
+          canReimbursementAmount: '', // 业务可报销额度
+          surplusReimbursementAmount: '', // 业务剩余可报销额度
+          reimbursementDay: '' // 报销天数
+
+        }
+      }
+    },
+    ReimbursementBusiness: null,
+    created () {
+      this.reimbursementBusiness = new ReimbursementBusiness()
+    },
+    mounted () {
+    },
+    components: {
+      SelectUserTree
+    },
+    provide () {
+      return {
+        say: this.say
+      }
+    },
+    methods: {
+      checkInputs: function (num) {
+        console.log(num)
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^]+/g, '') // 保留数字
+        // 获取日报销额度
+        let reimbursementQuotaDayNumber = this.inputForm.reimbursementQuotaDay
+        if (reimbursementQuotaDayNumber) {
+          this.inputForm.reimbursementAmount = (str * reimbursementQuotaDayNumber).toString()
+        }
+        return str
+      },
+      say (userId) {
+        // 根据用户id查询年份信息
+        this.reimbursementBusiness.yearList({userId: userId, current: 1, size: -1}).then(({data}) => {
+          this.yearList = data.records
+          if (this.yearList.length > 0) {
+            this.inputForm.year = this.yearList[0].year
+            this.inputForm.reimbursementQuotaDay = this.yearList[0].reimbursementQuotaDay
+            this.inputForm.reimbursementQuota = this.yearList[0].reimbursementQuota
+            this.inputForm.remainReimbursementAmount = this.yearList[0].remainReimbursementAmount
+
+            // 获取日报销额度
+            let reimbursementQuotaDayNumber = this.inputForm.reimbursementQuotaDay
+            let reimbursementDayNumber = this.inputForm.reimbursementDay
+            if (reimbursementQuotaDayNumber && reimbursementDayNumber) {
+              this.inputForm.reimbursementAmount = (reimbursementDayNumber * reimbursementQuotaDayNumber).toString()
+            }
+          } else {
+            this.inputForm.year = ''
+            this.inputForm.reimbursementQuotaDay = ''
+            this.inputForm.reimbursementQuota = ''
+            this.inputForm.remainReimbursementAmount = ''
+          }
+        })
+      },
+      selectYear (year) {
+        for (var yearKey in this.yearList) {
+          if (this.yearList[yearKey].year === year) {
+            this.inputForm.reimbursementQuotaDay = this.yearList[yearKey].reimbursementQuotaDay
+            this.inputForm.reimbursementQuota = this.yearList[yearKey].reimbursementQuota
+            this.inputForm.remainReimbursementAmount = this.yearList[yearKey].remainReimbursementAmount
+
+            // 获取日报销额度
+            let reimbursementQuotaDayNumber = this.inputForm.reimbursementQuotaDay
+            let reimbursementDayNumber = this.inputForm.reimbursementDay
+            if (reimbursementQuotaDayNumber && reimbursementDayNumber) {
+              this.inputForm.reimbursementAmount = (reimbursementDayNumber * reimbursementQuotaDayNumber).toString()
+            }
+          }
+        }
+      },
+      init (method, obj) {
+        this.method = method
+        this.inputForm.businessCodeId = obj.businessCodeId
+        this.inputForm.businessCode = obj.businessCode
+        if (method === 'addBusinessInfo') {
+          this.title = `新建报销信息`
+        } else if (method === 'edit') {
+          this.title = '修改人员信息'
+        } else if (method === 'view') {
+          this.title = '查看人员信息'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.inputForm.id = obj.id
+          this.$refs['inputForm'].resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.inputForm.id = obj
+            this.loading = true
+            this.reimbursementBusiness.queryById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+          if (method === 'addBusinessInfo') { // 修改或者查看
+            this.inputForm.businessCodeId = obj.businessCodeId
+            this.loading = true
+            this.reimbursementBusiness.getBusinessById(this.inputForm.businessCodeId).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementBusiness.save(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.visible = false
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 97 - 0
src/views/modules/reimbursementSys/reimbursementBusinessList.vue

@@ -0,0 +1,97 @@
+<template>
+  <div class="el-scrollbar__wrap wrap-white padding-20">
+    <div class="el-scrollbar__view">
+      <el-row :gutter="20" v-loading="loading">
+        <el-col :span="12">
+          <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" label-width="150px">
+          </el-form>
+        </el-col>
+        <el-col :span="24">
+          <el-col :span="12"><h3>业务报销详情</h3></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%">
+            <el-table-column
+              prop="userName"
+              label="报销人"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="year"
+              label="报销年份"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="reimbursementDay"
+              label="报销天数"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="reimbursementAmount"
+              label="报销额度"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="createDate"
+              label="报销时间"
+            >
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  import ReimbursementBusiness from '@/api/reimbursementSys/reimbursementBusinessService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        previewVisible: false,
+        isIndeterminate: false,
+        inputForm: {
+          id: '',
+          dataSource: {
+            id: ''
+          },
+          name: '',
+          sqlCmd: ''
+        },
+        columnForm: {
+          isNeedAll: true,
+          columnList: []
+        }
+      }
+    },
+    reimbursementBusiness: null,
+    created () {
+      this.reimbursementBusiness = new ReimbursementBusiness()
+    },
+    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.columnForm.columnList = data
+        })
+      }
+    },
+    components: {
+      editor: require('vue2-ace-editor')
+    },
+    methods: {
+      goBack () {
+        this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+        this.$router.push('/reimbursementSys/reimbursementList')
+      }
+    }
+  }
+</script>

+ 37 - 11
src/views/modules/reimbursementSys/reimbursementList.vue

@@ -31,7 +31,7 @@
             </el-upload>
             </el-upload>
 
 
 
 
-            <el-button style="margin-left: 10px" v-if="hasPermission('sys:office:del')" :disabled="$refs.xTree && $refs.xTree.getCheckboxRecords().length === 0" type="danger" size="small" icon="el-icon-delete" @click="del()" plain>删除</el-button>
+            <el-button style="margin-left: 10px" v-if="hasPermission('reimbursement:del')" :disabled="$refs.xTree && $refs.xTree.getCheckboxRecords().length === 0" type="danger" size="small" icon="el-icon-delete" @click="del()" plain>删除</el-button>
 
 
           </el-row>
           </el-row>
 
 
@@ -64,12 +64,13 @@
           </vxe-column>
           </vxe-column>
           <vxe-column  width="100px" title="发票代码" field="invoiceCode" align="center" ></vxe-column>
           <vxe-column  width="100px" title="发票代码" field="invoiceCode" align="center" ></vxe-column>
           <vxe-column  width="100px" title="发票号码" field="invoiceNumber" align="center"></vxe-column>
           <vxe-column  width="100px" title="发票号码" field="invoiceNumber" align="center"></vxe-column>
-          <vxe-column  width="200px" title="购方企业名称" field="firmName" align="center"></vxe-column>
-          <vxe-column  width="100px" title="开票日期" field="makeTime" align="center"></vxe-column>
-          <vxe-column  width="150px" title="商品名称" field="name" align="center"></vxe-column>
           <vxe-column  width="100px" title="金额" field="money" align="center"></vxe-column>
           <vxe-column  width="100px" title="金额" field="money" align="center"></vxe-column>
           <vxe-column  width="100px" title="税额" field="tax" align="center"></vxe-column>
           <vxe-column  width="100px" title="税额" field="tax" align="center"></vxe-column>
           <vxe-column  width="100px" title="收入" field="income" align="center"></vxe-column>
           <vxe-column  width="100px" title="收入" field="income" align="center"></vxe-column>
+          <vxe-column  width="100px" title="报销比例" field="reimbursementRatio" align="center"></vxe-column>
+          <vxe-column  width="200px" title="购方企业名称" field="firmName" align="center"></vxe-column>
+          <vxe-column  width="100px" title="开票日期" field="makeTime" align="center"></vxe-column>
+          <vxe-column  width="150px" title="商品名称" field="name" align="center"></vxe-column>
           <vxe-column  width="100px" title="申请人" field="proposer" align="center"></vxe-column>
           <vxe-column  width="100px" title="申请人" field="proposer" align="center"></vxe-column>
           <vxe-column  width="100px" title="合伙人" field="partner" align="center"></vxe-column>
           <vxe-column  width="100px" title="合伙人" field="partner" align="center"></vxe-column>
           <vxe-column  width="100px" title="业务类型" field="businessType" align="center"></vxe-column>
           <vxe-column  width="100px" title="业务类型" field="businessType" align="center"></vxe-column>
@@ -79,11 +80,14 @@
 
 
           <vxe-column title="操作" width="300px" fixed="right" align="center">
           <vxe-column title="操作" width="300px" fixed="right" align="center">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.businessCode==='' && scope.row.parentId === '0'" type="text" icon="el-icon-edit" size="small" @click="editBusiness(scope.row.id)">修改业务编码</el-button>
-              <el-button v-if="scope.row.parentId !== '0'" type="text" icon="el-icon-view" size="small" @click="viewInvoice(scope.row.id)">查看发票详情</el-button>
-              <el-button v-if="scope.row.parentId !== '0' && !scope.row.gatheringTime" type="text" icon="el-icon-edit" size="small" @click="editInvoice(scope.row.id)">发票收款</el-button>
-              <el-button v-if="scope.row.parentId === '0'" type="text" icon="el-icon-delete" size="small" @click="delBusiness(scope.row.id)">删除</el-button>
-              <el-button v-if="scope.row.parentId !== '0'" type="text" icon="el-icon-delete" size="small" @click="delInvoice(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('reimbursement:edit') && scope.row.businessCode==='' && scope.row.parentId === '0'" type="text" icon="el-icon-edit" size="small" @click="editBusiness(scope.row.id)">修改业务编码</el-button>
+              <el-button v-if="hasPermission('reimbursement:edit') && scope.row.businessCode !== '' && !scope.row.reimbursementRatio && scope.row.parentId === '0'" type="text" icon="el-icon-edit" size="small" @click="editBusinessRatio(scope.row.id)">编辑报销比例</el-button>
+              <el-button v-if="hasPermission('reimbursementBusiness:add') && scope.row.businessCode !== '' && scope.row.reimbursementRatio && scope.row.parentId === '0'" type="text" icon="el-icon-plus" size="small" @click="addBusinessInfo(scope.row.id, scope.row.businessCode)">业务报销</el-button>
+              <el-button v-if="hasPermission('reimbursementBusiness:view') && scope.row.businessCode !== '' && scope.row.reimbursementRatio && scope.row.parentId === '0'" type="text" icon="el-icon-view" size="small" @click="viewBusinessInfo(scope.row.id)">业务报销详情</el-button>
+              <el-button v-if="hasPermission('reimbursement:view') && scope.row.parentId !== '0'" type="text" icon="el-icon-view" size="small" @click="viewInvoice(scope.row.id)">查看发票详情</el-button>
+              <el-button v-if="hasPermission('reimbursement:edit') && scope.row.parentId !== '0' && !scope.row.gatheringTime" type="text" icon="el-icon-edit" size="small" @click="editInvoice(scope.row.id)">发票收款</el-button>
+              <el-button v-if="hasPermission('reimbursement:del') && scope.row.parentId === '0'" type="text" icon="el-icon-delete" size="small" @click="delBusiness(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('reimbursement:del') && scope.row.parentId !== '0'" type="text" icon="el-icon-delete" size="small" @click="delInvoice(scope.row.id)">删除</el-button>
             </template>
             </template>
           </vxe-column>
           </vxe-column>
         </vxe-table>
         </vxe-table>
@@ -101,6 +105,9 @@
     </div>
     </div>
     <!-- 弹窗, 新增 / 修改 -->
     <!-- 弹窗, 新增 / 修改 -->
     <reimbursementForm ref="reimbursementForm" @refreshDataList="refreshList"></reimbursementForm>
     <reimbursementForm ref="reimbursementForm" @refreshDataList="refreshList"></reimbursementForm>
+    <reimbursementRatioForm ref="reimbursementRatioForm" @refreshDataList="refreshList"></reimbursementRatioForm>
+    <reimbursementBusinessForm ref="reimbursementBusinessForm" @refreshDataList="refreshList"></reimbursementBusinessForm>
+    <reimbursementBusinessList ref="reimbursementBusinessList" @refreshDataList="refreshList"></reimbursementBusinessList>
     <reimbursementInvoiceForm ref="reimbursementInvoiceForm" @refreshDataList="refreshList"></reimbursementInvoiceForm>
     <reimbursementInvoiceForm ref="reimbursementInvoiceForm" @refreshDataList="refreshList"></reimbursementInvoiceForm>
   </div>
   </div>
 
 
@@ -110,14 +117,18 @@
 import ReimbursementSys from '@/api/reimbursementSys/reimbursementSysService'
 import ReimbursementSys from '@/api/reimbursementSys/reimbursementSysService'
 import XEUtils from 'xe-utils'
 import XEUtils from 'xe-utils'
 import reimbursementForm from './reimbursementForm'
 import reimbursementForm from './reimbursementForm'
+import reimbursementRatioForm from './reimbursementRatioForm'
 import reimbursementInvoiceForm from './reimbursementInvoiceForm'
 import reimbursementInvoiceForm from './reimbursementInvoiceForm'
+import reimbursementBusinessForm from './reimbursementBusinessForm'
+import reimbursementBusinessList from './reimbursementBusinessList'
 export default {
 export default {
   data () {
   data () {
     return {
     return {
       dataList: [],
       dataList: [],
       searchForm: {
       searchForm: {
         businessCode: '',
         businessCode: '',
-        invoiceNumber: ''
+        invoiceNumber: '',
+        reimbursementRatio: ''
       },
       },
       tablePage: {
       tablePage: {
         total: 0,
         total: 0,
@@ -130,7 +141,10 @@ export default {
   },
   },
   components: {
   components: {
     reimbursementForm,
     reimbursementForm,
-    reimbursementInvoiceForm
+    reimbursementRatioForm,
+    reimbursementInvoiceForm,
+    reimbursementBusinessForm,
+    reimbursementBusinessList
   },
   },
   ReimbursementSys: null,
   ReimbursementSys: null,
   created () {
   created () {
@@ -203,6 +217,18 @@ export default {
     editBusiness (id) {
     editBusiness (id) {
       this.$refs.reimbursementForm.init('editBusiness', {id: id, parent: {id: '', name: ''}})
       this.$refs.reimbursementForm.init('editBusiness', {id: id, parent: {id: '', name: ''}})
     },
     },
+    // 修改
+    editBusinessRatio (id) {
+      this.$refs.reimbursementRatioForm.init('editBusinessRatio', {id: id, parent: {id: '', name: ''}})
+    },
+    // 修改
+    addBusinessInfo (id, businessCode) {
+      this.$refs.reimbursementBusinessForm.init('addBusinessInfo', {id: '', businessCodeId: id, businessCode: businessCode, parent: {id: '', name: ''}})
+    },
+    // 查看业务报销详情
+    viewBusinessInfo (id) {
+      this.$router.push({path: `/reimbursementSys/reimbursementBusinessList`, query: {id: id, title: '业务报销详情'}})
+    },
     // 修改发票信息
     // 修改发票信息
     editInvoice (id) {
     editInvoice (id) {
       this.$refs.reimbursementInvoiceForm.init('editInvoice', {id: id, parent: {id: '', name: ''}})
       this.$refs.reimbursementInvoiceForm.init('editInvoice', {id: id, parent: {id: '', name: ''}})

+ 129 - 0
src/views/modules/reimbursementSys/reimbursementRatioForm.vue

@@ -0,0 +1,129 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+     v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="80px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+      <el-row :gutter="15">
+
+        <el-col :span="12">
+          <el-form-item label="业务编码" prop="businessCode" :rules=" [{required: true,max: 50, message: '业务编号不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessCode" placeholder="业务编码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="报销比例" prop="reimbursementRatio":rules="[{required: true, max: 10, message:'报销比例不能为空', trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementRatio" class="bg-grey" size="small" placeholder="报销比例" style="width: 100%;" @keyup.native="inputForm.reimbursementRatio = checkInputs(inputForm.reimbursementRatio)">
+                </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method != 'view'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/reimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '', // 业务编码
+          reimbursementRatio: '' // 报销比例
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      checkInputs (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      init (method, obj) {
+        this.method = method
+        if (method === 'editBusinessRatio') {
+          this.title = '修改报销比例'
+        } else if (method === 'view') {
+          this.title = '查看业务编码'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+          this.inputForm.parent.id = obj.parent.id
+          this.inputForm.parent.name = obj.parent.name
+          if (method === 'editBusinessRatio' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryBusinessById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.updateReimbursementRatio(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500
+              })
+              this.visible = false
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 291 - 0
src/views/modules/reimbursementSys/treeReimbursementBuinessUserSelect.vue

@@ -0,0 +1,291 @@
+<template>
+  <el-select :value="valueTitle" :size="size"  :disabled="disabled" :clearable="clearable" :placeholder="placeholderText" @clear="clearHandle">
+    <el-option :value="valueTitle"  :label="valueTitle" class="options">
+      <el-tree  id="tree-option"
+        ref="selectTree"
+        :accordion="accordion"
+        :data="optionData"
+        :show-checkbox="showCheckbox"
+        :props="props"
+        highlight-current
+        :node-key="props.value"
+        :default-expanded-keys="defaultExpandedKey"
+        @check-change="handleCheckChange"
+        @node-click="handleNodeClick">
+      </el-tree>
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+export default {
+  inject: ['say'],
+  name: 'el-tree-select',
+  props: {
+    /* 配置项 */
+    props: {
+      type: Object,
+      default: () => {
+        return {
+          value: 'id',             // ID字段名
+          label: 'label',         // 显示名称
+          children: 'children'    // 子级字段名
+        }
+      }
+    },
+    /* 选项列表数据(树形结构的对象数组) */
+    data: {
+      type: Array,
+      default: () => { return [] }
+    },
+     /* 选项列表数据(树形结构的对象数组) */
+    list: {
+      type: Array,
+      default: () => { return null }
+    },
+    /* 初始值 */
+    value: {
+      type: String,
+      default: () => { return null }
+    },
+        /* 初始值 */
+    url: {
+      type: String,
+      default: () => { return null }
+    },
+    disabled: {
+      type: Boolean,
+      dafault: () => { return false }
+    },
+    showCheckbox: {
+      type: Boolean,
+      dafault: () => { return false }
+    },
+    /* 初始值 */
+    label: {
+      type: String,
+      default: () => { return null }
+    },
+    /* 可清空选项 */
+    clearable: {
+      type: Boolean,
+      default: () => { return true }
+    },
+    /* 自动收起 */
+    accordion: {
+      type: Boolean,
+      default: () => { return false }
+    },
+    size: {
+      type: String,
+      default: () => { return 'small' }
+    },
+    placeholder: {
+      type: String,
+      default: () => { return '请选择' }
+    },
+    isOnlySelectLeaf: {
+      type: Boolean,
+      default: () => {
+        return false
+      }
+    }
+  },
+  data () {
+    return {
+      valueId: this.value,    // 初始值
+      valueTitle: this.label,
+      defaultExpandedKey: [],
+      placeholderText: this.placeholder,
+      treeList: [],
+      valueData: this.data
+    }
+  },
+  created () {
+    if (this.url !== null) {
+      this.placeholderText = '加载数据中...'
+      let interval = setInterval(() => {
+        this.placeholderText = this.placeholderText + '.'
+      }, 500)
+      this.$http({
+        url: this.url,
+        method: 'get'
+      }).then(({data}) => {
+        this.valueData = data
+        this.setTreeList(this.valueData)
+        this.$nextTick(() => {
+          this.initHandle()
+          this.placeholderText = this.placeholder
+          clearInterval(interval)
+        })
+      })
+    } else {
+      this.valueData = this.data
+      this.setTreeList(this.valueData)
+    }
+  },
+  methods: {
+    setTreeList (datas) { // 遍历树  获取id数组
+      for (var i in datas) {
+        this.treeList.push(datas[i])
+        if (datas[i].children) {
+          this.setTreeList(datas[i].children)
+        }
+      }
+    },
+    // 初始化值
+    initHandle () {
+      if (this.valueId) {
+        if (this.showCheckbox) {
+          let ids = this.valueId.split(',')
+          this.$refs.selectTree.setCheckedKeys(ids)
+          let titles = []
+          ids.forEach((id) => {
+            this.treeList.forEach((d) => {
+              if (id === d[this.props.value]) {
+                titles.push(d[this.props.label])
+              }
+            })
+          })
+
+          this.valueTitle = titles.join(',')
+        } else if (this.$refs.selectTree.getNode(this.valueId)) {
+          this.valueTitle = this.$refs.selectTree.getNode(this.valueId).data[this.props.label]     // 初始化显示
+          this.$refs.selectTree.setCurrentKey(this.valueId)       // 设置默认选中
+          this.defaultExpandedKey = [this.valueId]      // 设置默认展开
+        }
+      }
+      this.initScroll()
+    },
+    getNode (id) {
+      return this.$refs.selectTree.getNode(id)
+    },
+    // 初始化滚动条
+    initScroll () {
+      this.$nextTick(() => {
+        let scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0]
+        let scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar')
+        if (scrollWrap) { scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;' }
+        if (scrollBar) {
+          scrollBar.forEach(ele => {
+          // eslint-disable-next-line no-return-assign
+            return ele.style.width = 0
+          })
+        }
+      })
+    },
+    // 切换选项
+    handleNodeClick (node) {
+      if (this.showCheckbox) {
+        return
+      }
+      if (node['disabled'] || node['typeFlag']) {
+        this.$message.warning('节点(' + node[this.props.label] + ')被禁止选择,请重新选择。')
+        return
+      }
+      if (this.isOnlySelectLeaf && node.children.length > 0) {
+        this.$message.warning('不能选择根节点(' + node[this.props.label] + ')请重新选择。')
+        return
+      }
+      this.valueTitle = node[this.props.label]
+      this.valueId = node[this.props.value]
+      this.$emit('getValue', this.valueId, this.valueTitle, node)
+      // 调用主页面的方法
+      this.say(this.valueId)
+    },
+    handleCheckChange (data, checked, indeterminate) {
+      let nodes = this.$refs.selectTree.getCheckedNodes()
+      this.valueTitle = nodes.map((node) => {
+        return node[this.props.label]
+      }).join(',')
+      this.valueId = nodes.map((node) => {
+        return node[this.props.value]
+      }).join(',')
+      this.$emit('getValue', this.valueId, this.valueTitle)
+    },
+    // 清除选中
+    clearHandle () {
+      this.valueTitle = ''
+      this.valueId = null
+      this.defaultExpandedKey = []
+      this.clearSelected()
+      this.$emit('getValue', null, null, null)
+    },
+    /* 清空选中样式 */
+    clearSelected () {
+      let allNode = document.querySelectorAll('#tree-option .el-tree-node')
+      allNode.forEach((element) => element.classList.remove('is-current'))
+    }
+  },
+  watch: {
+    value () {
+      this.valueId = this.value
+      if (this.value === '' || this.value === null || this.value === undefined) {
+        this.clearHandle()
+      } else {
+        this.initHandle()
+      }
+    },
+    data () {
+      this.valueData = this.data
+    }
+  },
+  computed: {
+    optionData () {
+      if (this.list) {
+        let cloneData = JSON.parse(JSON.stringify(this.list))      // 对源数据深度克隆
+        return cloneData.filter(father => {                      // 循环所有项,并添加children属性
+          let branchArr = cloneData.filter(child => father.id === child.parentId)       // 返回每一项的子级数组
+            // eslint-disable-next-line no-unused-expressions
+          branchArr.length > 0 ? father.children = branchArr : ''   // 给父级添加一个children属性,并赋值
+          return father.parentId === '0'      // 返回第一层
+        })
+      } else {
+        return this.valueData
+      }
+    }
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+  .el-select{
+    width: 100%;
+  }
+  .el-scrollbar .el-scrollbar__view .el-select-dropdown__item{
+    height: auto;
+    max-height: 274px;
+    padding: 0;
+    overflow: hidden;
+    overflow-y: auto;
+  }
+  .el-select-dropdown__item.selected{
+    font-weight: normal;
+  }
+  ul li >>>.el-tree .el-tree-node__content{
+    height:auto;
+    padding: 0 20px;
+  }
+  .el-tree-node__label{
+    font-weight: normal;
+  }
+  .el-tree >>>.is-current .el-tree-node__label{
+    color: #409EFF;
+    font-weight: 700;
+  }
+  .el-tree >>>.is-current .el-tree-node__children .el-tree-node__label{
+    color:#606266;
+    font-weight: normal;
+  }
+  /* 开发禁用 */
+  /* .el-tree-node:focus>.el-tree-node__content{
+    background-color:transparent;
+    background-color: #f5f7fa;
+    color: #c0c4cc;
+    cursor: not-allowed;
+  }
+  .el-tree-node__content:hover{
+    background-color: #f5f7fa;
+  } */
+</style>

+ 97 - 0
src/views/modules/reimbursementSys/user/reimbursementUserBusinessList.vue

@@ -0,0 +1,97 @@
+<template>
+  <div class="el-scrollbar__wrap wrap-white padding-20">
+    <div class="el-scrollbar__view">
+      <el-row :gutter="20" v-loading="loading">
+        <el-col :span="12">
+          <el-form size="small" :model="inputForm" ref="inputForm" v-loading="loading" label-width="150px">
+          </el-form>
+        </el-col>
+        <el-col :span="24">
+          <el-col :span="12"><h3>人员报销详情</h3></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%">
+            <el-table-column
+              prop="businessCode"
+              label="业务编号"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="year"
+              label="报销年份"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="reimbursementDay"
+              label="报销天数"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="reimbursementAmount"
+              label="报销额度"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="createDate"
+              label="报销时间"
+            >
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  import ReimbursementUser from '@/api/reimbursementSys/user/reimbursementUserService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        previewVisible: false,
+        isIndeterminate: false,
+        inputForm: {
+          id: '',
+          dataSource: {
+            id: ''
+          },
+          name: '',
+          sqlCmd: ''
+        },
+        columnForm: {
+          isNeedAll: true,
+          columnList: []
+        }
+      }
+    },
+    reimbursementUser: null,
+    created () {
+      this.reimbursementUser = new ReimbursementUser()
+    },
+    activated () {
+      this.$refs['inputForm'].resetFields()
+      this.columnForm.columnList = []
+      this.inputForm.id = this.$route.query.id
+      if (this.inputForm.id) {
+        this.reimbursementUser.findListByUserId(this.inputForm.id).then(({data}) => {
+          this.columnForm.columnList = data
+        })
+      }
+    },
+    components: {
+      editor: require('vue2-ace-editor')
+    },
+    methods: {
+      goBack () {
+        this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+        this.$router.push('/reimbursementSys/user/reimbursementUserList')
+      }
+    }
+  }
+</script>

+ 170 - 0
src/views/modules/reimbursementSys/user/reimbursementUserForm.vue

@@ -0,0 +1,170 @@
+<template>
+  <el-dialog
+    :title="title"
+    :close-on-click-modal="false"
+    v-dialogDrag
+    :visible.sync="visible">
+    <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
+             label-width="120px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
+
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item prop="userId" :rules=" [{required: true, message: '人员不能为空', trigger: 'blur'}]" label="人员">
+            <SelectUserTree
+              ref="companyTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              :url="`/sys/user/treeUserData?type=2`"
+              :value="inputForm.userId"
+              :clearable="true"
+              :accordion="true"
+              :disabled="method==='edit'"
+              @getValue="(value) => {inputForm.userId=value}"/>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="年份" id="year" prop="year"
+                        :rules="[
+                  {required: true, message:'年份不能为空', trigger:'blur'}
+                 ]">
+            <el-date-picker
+              v-model="inputForm.year"
+              type="year"
+              value-format="yyyy"
+              placeholder="选择年份">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="日报销额度"  id="reimbursementQuotaDay" prop="reimbursementQuotaDay":rules="[{required: true, max: 10, message:'日报销额度不能为空', trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementQuotaDay" class="bg-grey" size="small" placeholder="日报销额度" style="width: 100%;" @keyup.native="inputForm.reimbursementQuotaDay = checkInputs(inputForm.reimbursementQuotaDay)">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="年报销额度" prop="reimbursementQuota":rules="[{required: true, max: 10, message:'年报销额度不能为空', trigger:'blur'}]">
+            <el-input v-model="inputForm.reimbursementQuota" class="bg-grey" size="small" placeholder="年报销额度" style="width: 100%;" @keyup.native="inputForm.reimbursementQuota = checkInputs(inputForm.reimbursementQuota)">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import SelectUserTree from '@/components/treeSelect/treeUserSelect.vue'
+  import ReimbursementUser from '@/api/reimbursementSys/user/reimbursementUserService'
+  export default {
+    data () {
+      return {
+        visible: false,
+        loading: false,
+        title: '',
+        method: '',
+        roleList: [],
+        postList: [],
+        inputForm: {
+          id: '',
+          userId: '', // 人员id
+          year: '', // 年份
+          reimbursementQuota: '', // 年报销额度
+          reimbursementQuotaDay: '' // 日报销额度
+
+        }
+      }
+    },
+    reimbursementUser: null,
+    created () {
+      this.reimbursementUser = new ReimbursementUser()
+    },
+    mounted () {
+    },
+    components: {
+      SelectUserTree
+    },
+    methods: {
+      checkInputs: function (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      init (method, obj) {
+        this.method = method
+        this.inputForm.id = obj
+        if (method === 'add') {
+          this.inputForm.id = obj.id
+          this.title = `新建人员信息`
+        } else if (method === 'edit') {
+          this.title = '修改人员信息'
+        } else if (method === 'view') {
+          this.title = '查看人员信息'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.inputForm.id = obj.id
+          this.$refs['inputForm'].resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.inputForm.id = obj
+            this.loading = true
+            this.reimbursementUser.queryById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementUser.save(this.inputForm).then(({data}) => {
+              this.loading = false
+              this.visible = false
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 210 - 0
src/views/modules/reimbursementSys/user/reimbursementUserList.vue

@@ -0,0 +1,210 @@
+<template>
+
+  <div class="page">
+    <el-form size="small" :inline="true"  class="query-form" ref="searchForm" :model="searchForm"  @keyup.enter.native="refreshList()" @submit.native.prevent>
+
+      <el-form-item prop="userId" :rules=" [{trigger: 'blur'}]" label="人员">
+        <SelectUserTree
+          ref="companyTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+          :url="`/sys/user/treeUserData?type=2`"
+          :value="searchForm.userId"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value) => {searchForm.userId=value}"/>
+      </el-form-item>
+
+      <el-form-item label="年份" prop="year":rules="[{trigger:'blur'}]">
+        <el-date-picker
+          v-model="searchForm.year"
+          type="year"
+          value-format="yyyy"
+          placeholder="选择年份">
+        </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-form-item>
+    </el-form>
+    <div class="bg-white top">
+      <vxe-toolbar :refresh="{query: refreshList}" export print custom>
+        <template #buttons>
+          <el-row>
+            <el-button v-if="hasPermission('reimbursementUser:add')" type="primary" icon="el-icon-plus" size="small" @click="add()">新增</el-button>
+            <el-button v-if="hasPermission('reimbursementUser:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.reimbursementUserTable && $refs.reimbursementUserTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+          </el-row>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 80px);">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="reimbursementUserTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          :import-config="{}"
+          :export-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="checkbox" width="40px"> </vxe-column>
+          <vxe-column  title="人员" field="user.name">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('reimbursementUser:edit')" @click="edit(scope.row.id)">{{scope.row.user.name}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('reimbursementUser:view')"  @click="view(scope.row.id,)">{{scope.row.user.name}}</el-link>
+              <span v-else>{{scope.row.user.name}}</span>
+            </template>
+          </vxe-column>
+
+          <vxe-column  title="报销年份" field="year"></vxe-column>
+          <vxe-column  title="日报销额度" field="reimbursementQuotaDay"></vxe-column>
+          <vxe-column  title="年报销额度" field="reimbursementQuota"></vxe-column>
+          <vxe-column title="操作" width="300px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('reimbursementUser:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
+              <el-button v-if="hasPermission('reimbursementUser:view')" type="text" icon="el-icon-view" size="small" @click="viewBusinessInfo(scope.row.id)">查看报销详情</el-button>
+              <el-button v-if="hasPermission('reimbursementUser:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('reimbursementUser:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <!-- 弹窗, 新增 / 修改 -->
+    <reimbursementUserForm ref="reimbursementUserForm" @refreshDataList="refreshList"></reimbursementUserForm>
+  </div>
+
+
+</template>
+<script>
+import SelectUserTree from '@/components/treeSelect/treeUserSelect.vue'
+import ReimbursementUser from '@/api/reimbursementSys/user/reimbursementUserService'
+import reimbursementUserForm from './reimbursementUserForm'
+export default {
+  data () {
+    return {
+      dataList: [],
+      searchForm: {
+        year: '',
+        userId: ''
+      },
+      tablePage: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        orders: [{column: 'a.create_date', asc: false}]
+      },
+      loading: false
+    }
+  },
+  components: {
+    SelectUserTree,
+    reimbursementUserForm
+  },
+  ReimbursementUser: null,
+  created () {
+    this.reimbursementUser = new ReimbursementUser()
+  },
+  activated () {
+    this.refreshList()
+  },
+  methods: {
+    // 获取数据列表
+    refreshList () {
+      this.loading = true
+      this.reimbursementUser.findList({
+        'current': this.tablePage.currentPage,
+        'size': this.tablePage.pageSize,
+        'orders': this.tablePage.orders,
+        ...this.searchForm
+      }).then(({data}) => {
+        this.dataList = data.records
+        this.tablePage.total = data.total
+        this.loading = false
+      })
+    },
+    // 当前页
+    currentChangeHandle ({ currentPage, pageSize }) {
+      this.tablePage.currentPage = currentPage
+      this.tablePage.pageSize = pageSize
+      this.refreshList()
+    },
+    resetSearch () {
+      this.$refs.searchForm.resetFields()
+      this.$nextTick(() => {
+        this.refreshList()
+      })
+    },
+    // 排序
+    sortChangeHandle (column) {
+      this.tablePage.orders = []
+      if (column.order != null) {
+        this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+      }
+      this.refreshList()
+    },
+    // 新增
+    add () {
+      this.$refs.reimbursementUserForm.init('add', {id: '', parent: {id: '', name: ''}})
+    },
+    // 修改
+    edit (id) {
+      this.$refs.reimbursementUserForm.init('edit', id)
+    },
+    // 查看
+    view (id) {
+      this.$refs.reimbursementUserForm.init('view', id)
+    },
+    // 查看业务报销详情
+    viewBusinessInfo (id) {
+      this.$router.push({path: `/reimbursementSys/user/reimbursementUserBusinessList`, query: {id: id, title: '报销详情'}})
+    },
+    // 删除
+    del (id) {
+      let ids = id || this.$refs.reimbursementUserTable.getCheckboxRecords().map(item => {
+        return item.id
+      }).join(',')
+      this.$confirm(`确定删除该记录吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.reimbursementUser.delete(ids).then(({data}) => {
+          this.loading = false
+          this.$message({
+            message: data,
+            type: 'success',
+            duration: 1500
+          })
+          this.refreshList()
+        })
+      })
+    }
+  }
+
+}
+</script>

+ 1 - 1
src/views/modules/sys/post/PostForm.vue

@@ -142,4 +142,4 @@
       }
       }
     }
     }
   }
   }
-</script>
+</script>