ソースを参照

Merge remote-tracking branch 'origin/master'

chenyuesheng 2 年 前
コミット
47d88d06da

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

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

+ 91 - 0
src/api/reimbursementSys/wuHanReimbursementSysService.js

@@ -0,0 +1,91 @@
+import request from '@/utils/httpRequest'
+
+export default class reimbursementSys {
+  treeData (params) {
+    return request({
+      url: '/wuHanReimbursement/treeData',
+      method: 'get',
+      params: params
+    })
+  }
+
+  saveBusiness (inputForm) {
+    return request({
+      url: `/wuHanReimbursement/saveBusiness`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  saveGatheringTime (inputForm) {
+    return request({
+      url: `/wuHanReimbursement/saveGatheringTime`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  updateReimbursementRatio (inputForm) {
+    return request({
+      url: `/wuHanReimbursement/updateReimbursementRatio`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  saveInvoice (inputForm) {
+    return request({
+      url: `/wuHanReimbursement/saveInvoice`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  modifyInvoice (inputForm) {
+    return request({
+      url: `/wuHanReimbursement/modifyInvoice`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+
+  deleteBusiness (ids) {
+    return request({
+      url: '/wuHanReimbursement/deleteBusiness',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+
+  deleteInvoice (ids) {
+    return request({
+      url: '/wuHanReimbursement/deleteInvoice',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+
+  delete (ids) {
+    return request({
+      url: '/wuHanReimbursement/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+
+  queryBusinessById (id) {
+    return request({
+      url: `/wuHanReimbursement/queryBusinessById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+
+  queryInvoiceById (id) {
+    return request({
+      url: `/wuHanReimbursement/queryInvoiceById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 326 - 0
src/views/modules/reimbursementSys/wuHanReimbursementBusinessForm.vue

@@ -0,0 +1,326 @@
+<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"  v-if="method !== 'read'">
+          <el-form-item label="报销类型" prop="reimbursementType"
+                        :rules="[
+                  {required: true, message:'报销类型不能为空', trigger:'blur'}
+                 ]">
+            <el-radio-group v-model="inputForm.reimbursementType">
+              <el-radio v-for="item in $dictUtils.getDictList('reimbursement_type')" @change="selectReimbursementType(inputForm.reimbursementType)" :label="item.value" :key="item.id">{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12" v-if="this.show">
+          <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" v-if="this.show">
+          <el-form-item label="剩余报销天数" prop="surplusReimbursementDay" :rules="[{ max: 10, trigger:'blur'}]">
+            <el-input v-model="inputForm.surplusReimbursementDay" 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="reimbursementAmount":rules="[{required: true, max: 10, message:'报销金额不可为空', max: 10,trigger:'blur'}]">
+            <el-input id="reimbursementAmount" v-model="inputForm.reimbursementAmount" class="bg-grey" size="small" placeholder="报销金额" style="width: 100%;" v-bind:disabled="this.show" @keyup.native="inputForm.reimbursementAmount = checkReimbursementAmount(inputForm.reimbursementAmount)">
+                </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12" v-if="this.show">
+          <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-col :span="24">
+          <el-form-item label="备注" prop="remarks" :rules="[{max: 255, trigger:'blur'}]">
+            <el-input type="textarea" v-model="inputForm.remarks" oninput="if(value.length>255)value=value.slice(0,254)" placeholder="备注" > </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/wuHanReimbursementBusinessService'
+  export default {
+    data () {
+      return {
+        show: false,
+        visible: false,
+        loading: false,
+        title: '',
+        method: '',
+        yearList: [],
+        inputForm: {
+          id: '',
+          userId: '', // 人员id
+          year: '', // 年份
+          reimbursementType: '', // 报销类型
+          reimbursementQuota: '', // 年报销额度
+          reimbursementAmount: '', // 报销金额
+          reimbursementQuotaDay: '', // 日报销额度
+          canReimbursementAmount: '', // 业务可报销额度
+          surplusReimbursementAmount: '', // 业务剩余可报销额度
+          reimbursementDay: '', // 报销天数
+          surplusReimbursementDay: '', // 剩余报销天数
+          oldSurplusReimbursementDay: '', // 剩余报销天数(比较数据)
+          remarks: '' // 备注
+
+        }
+      }
+    },
+    ReimbursementBusiness: null,
+    created () {
+      this.reimbursementBusiness = new ReimbursementBusiness()
+    },
+    mounted () {
+    },
+    components: {
+      SelectUserTree
+    },
+    provide () {
+      return {
+        say: this.say
+      }
+    },
+    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 no-useless-escape
+        str = str.replace(/[^\d^]+/g, '') // 保留数字
+        // 获取日报销额度
+        let reimbursementQuotaDayNumber = this.inputForm.reimbursementQuotaDay
+        if (reimbursementQuotaDayNumber) {
+          var oldSurplusReimbursementDay = this.inputForm.oldSurplusReimbursementDay
+          this.inputForm.reimbursementAmount = (str * reimbursementQuotaDayNumber).toString()
+          this.inputForm.surplusReimbursementDay = (oldSurplusReimbursementDay - str).toString()
+        }
+        return str
+      },
+      checkReimbursementAmount: 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 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
+      },
+      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
+            this.inputForm.surplusReimbursementDay = this.yearList[0].surplusReimbursementDay
+            this.inputForm.oldSurplusReimbursementDay = this.yearList[0].surplusReimbursementDay
+
+            // 获取日报销额度
+            let reimbursementQuotaDayNumber = this.inputForm.reimbursementQuotaDay
+            let reimbursementDayNumber = this.inputForm.reimbursementDay
+            if (reimbursementQuotaDayNumber && reimbursementDayNumber) {
+              var oldSurplusReimbursementDay = this.inputForm.oldSurplusReimbursementDay
+              this.inputForm.reimbursementAmount = (reimbursementDayNumber * reimbursementQuotaDayNumber).toString()
+              this.inputForm.surplusReimbursementDay = (oldSurplusReimbursementDay - reimbursementDayNumber).toString()
+            }
+          } else {
+            this.inputForm.year = ''
+            this.inputForm.reimbursementQuotaDay = ''
+            this.inputForm.reimbursementQuota = ''
+            this.inputForm.remainReimbursementAmount = ''
+            this.inputForm.surplusReimbursementDay = ''
+            this.inputForm.oldSurplusReimbursementDay = ''
+          }
+        })
+      },
+      selectReimbursementType (reimbursementType) {
+        if (reimbursementType === '1') {
+          // reimbursementAmount.isdisabled = true
+          this.show = true
+        } else {
+          this.show = false
+        }
+      },
+      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.selectReimbursementType(this.inputForm.reimbursementType)
+              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.selectReimbursementType(this.inputForm.reimbursementType)
+              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>

+ 116 - 0
src/views/modules/reimbursementSys/wuHanReimbursementBusinessList.vue

@@ -0,0 +1,116 @@
+<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>
+            <div style="margin-bottom: 5px;">
+              <span class="color: red">可报销额度:{{columnForm.reimbursementQuota}}</span>
+              <span class="color: red">;  已报销额度:{{columnForm.alreadyReimbursementAmount}}</span>
+              <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%">
+            <el-table-column
+              prop="userName"
+              label="报销人"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="year"
+              label="报销年份"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="reimbursementType"
+              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-column
+              prop="remarks"
+              label="备注"
+              width="200px"
+            >
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  import ReimbursementBusiness from '@/api/reimbursementSys/wuHanReimbursementBusinessService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        previewVisible: false,
+        isIndeterminate: false,
+        inputForm: {
+          id: '',
+          dataSource: {
+            id: ''
+          },
+          name: '',
+          sqlCmd: ''
+        },
+        columnForm: {
+          reimbursementQuota: '',  // 报销额度
+          alreadyReimbursementAmount: '',  // 已报销额度
+          surplusReimbursementAmount: '',  // 剩余报销额度
+          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.list
+          this.columnForm.reimbursementQuota = data.reimbursementQuota
+          this.columnForm.alreadyReimbursementAmount = data.alreadyReimbursementAmount
+          this.columnForm.surplusReimbursementAmount = data.surplusReimbursementAmount
+        })
+      }
+    },
+    methods: {
+      goBack () {
+        this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+        this.$router.push('/reimbursementSys/wuHanReimbursementList')
+      }
+    }
+  }
+</script>

+ 116 - 0
src/views/modules/reimbursementSys/wuHanReimbursementForm.vue

@@ -0,0 +1,116 @@
+<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 label="随机业务编码" prop="randomType">
+            <el-radio-group v-model="inputForm.randomType" @change="changeRadio(inputForm.randomType)">
+              <el-radio label="1">是</el-radio>
+              <el-radio label="0">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12"  v-if="this.isShow">
+          <el-form-item label="业务编码" prop="businessCode" :rules=" [{required: true ,max: 50, message: '业务编号不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessCode" placeholder="业务编码"></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/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        isShow: false,
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          randomType: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '' // 业务编码
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'editBusiness') {
+          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 === 'editBusiness' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryBusinessById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              if (this.inputForm.randomType === '1') {
+                this.isShow = false
+              } else {
+                this.isShow = true
+              }
+              this.loading = false
+            })
+          }
+        })
+      },
+      changeRadio (randomType) {
+        if (randomType === '1') {
+          this.isShow = false
+        } else {
+          this.isShow = true
+        }
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.saveBusiness(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>

+ 92 - 0
src/views/modules/reimbursementSys/wuHanReimbursementGatheringTimeForm.vue

@@ -0,0 +1,92 @@
+<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="gatheringTime"
+                        :rules="[
+                  {required: true, message:'收款日期不能为空', trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.gatheringTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </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/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          name: '',
+          parent: {
+            id: ''
+          },
+          gatheringTime: '' // 业务编码
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'edit') {
+          this.title = '修改收款日期'
+        }
+        this.visible = true
+        this.$nextTick(() => {
+          this.$refs['inputForm'].resetFields()
+          this.inputForm.id = obj.id
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementSys.saveGatheringTime(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>

+ 184 - 0
src/views/modules/reimbursementSys/wuHanReimbursementInvoiceForm.vue

@@ -0,0 +1,184 @@
+<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==='viewInvoice'?'readonly':''" :disabled="method==='viewInvoice'" @submit.native.prevent>
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item label="业务编号" prop="businessCode" :rules="[{max: 50, message: '最大长度不能超过50个字符', 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="businessType" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessType" placeholder="业务类型" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票代码" prop="invoiceCode" :rules=" [{required: true, message: '发票代码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceCode" placeholder="发票代码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票号码" prop="invoiceNumber" :rules=" [{required: true, message: '发票号码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceNumber" placeholder="发票号码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="购方企业名称" prop="firmName" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.firmName" placeholder="购方企业名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="开票日期" prop="makeTime"
+                        :rules="[
+                  {trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.makeTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="true"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="商品名称" prop="name" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.name" placeholder="商品名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="金额" prop="money" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.money" placeholder="金额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="税额" prop="tax" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.tax" placeholder="税额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="收入" prop="income" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.income" placeholder="收入" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="项目经理" prop="proposer" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.proposer" placeholder="项目经理" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="部门" prop="partner" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.partner" placeholder="部门" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="收款日期" prop="gatheringTime"
+                        :rules="[
+                  {required: true, message:'收款日期不能为空', trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.gatheringTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </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 != 'viewInvoice'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '', // 业务编号
+          invoiceCode: '', // 发票代码
+          invoiceNumber: '', // 发票号码
+          firmName: '', // 购方企业名称
+          makeTime: '', // 开票日期
+          name: '', // 商品名称
+          money: '', // 金额
+          tax: '', // 税额
+          income: '', // 收入
+          proposer: '', // 申请人
+          partner: '', // 合伙人
+          businessType: '', // 业务类型
+          gatheringTime: '' // 收款日期
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'editInvoice') {
+          this.title = '修改发票信息'
+        } else if (method === 'viewInvoice') {
+          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 === 'editInvoice' || method === 'viewInvoice') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryInvoiceById(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.saveInvoice(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>

+ 185 - 0
src/views/modules/reimbursementSys/wuHanReimbursementInvoiceModify.vue

@@ -0,0 +1,185 @@
+<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==='viewInvoice'?'readonly':''" :disabled="method==='viewInvoice'" @submit.native.prevent>
+      <el-row :gutter="15">
+        <el-col :span="12">
+          <el-form-item label="业务编号" prop="businessCode" :rules="[{max: 50, message: '最大长度不能超过50个字符', 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="businessType" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.businessType" placeholder="业务类型" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票代码" prop="invoiceCode" :rules=" [{required: true, message: '发票代码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceCode" placeholder="发票代码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发票号码" prop="invoiceNumber" :rules=" [{required: true, message: '发票号码不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.invoiceNumber" placeholder="发票号码" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="购方企业名称" prop="firmName" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.firmName" placeholder="购方企业名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="开票日期" prop="makeTime"
+                        :rules="[
+                  {trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.makeTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="true"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="商品名称" prop="name" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.name" placeholder="商品名称" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="金额" prop="money" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.money" placeholder="金额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="税额" prop="tax" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.tax" placeholder="税额" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="收入" prop="income" :rules="[{max: 50, message: '最大长度不能超过50个字符', trigger: 'blur'}]">
+            <el-input v-model="inputForm.income" placeholder="收入" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="项目经理" prop="proposer" :rules="[{max: 50, required: true, message:'项目经理不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.proposer" placeholder="项目经理" ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="部门" prop="partner" :rules="[{max: 50, required: true, message:'部门不能为空', trigger: 'blur'}]">
+            <el-input v-model="inputForm.partner" placeholder="部门" ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="收款日期" prop="gatheringTime"
+                        :rules="[
+                  {trigger:'blur'}
+                 ]">
+            <el-date-picker
+              style="width: 100%;"
+              v-model="inputForm.gatheringTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="true"
+              placeholder="选择日期时间">
+            </el-date-picker>
+          </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 != 'viewInvoice'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+  import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          parent: {
+            id: ''
+          },
+          businessCode: '', // 业务编号
+          invoiceCode: '', // 发票代码
+          invoiceNumber: '', // 发票号码
+          firmName: '', // 购方企业名称
+          makeTime: '', // 开票日期
+          name: '', // 商品名称
+          money: '', // 金额
+          tax: '', // 税额
+          income: '', // 收入
+          proposer: '', // 申请人
+          partner: '', // 合伙人
+          businessType: '', // 业务类型
+          gatheringTime: '' // 收款日期
+        }
+      }
+    },
+    reimbursementSys: null,
+    created () {
+      this.reimbursementSys = new ReimbursementSys()
+    },
+    methods: {
+      init (method, obj) {
+        this.method = method
+        if (method === 'modifyInvoice') {
+          this.title = '修改发票信息'
+        } else if (method === 'viewInvoice') {
+          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 === 'modifyInvoice' || method === 'viewInvoice') { // 修改或者查看
+            this.loading = true
+            this.reimbursementSys.queryInvoiceById(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.modifyInvoice(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>

+ 441 - 0
src/views/modules/reimbursementSys/wuHanReimbursementList.vue

@@ -0,0 +1,441 @@
+<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="businessCode">
+        <el-input size="small"  v-model="searchForm.businessCode"   placeholder="业务编号"   clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="invoiceNumber">
+        <el-input size="small"  v-model="searchForm.invoiceNumber"   placeholder="发票号码"   clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="firmName">
+        <el-input size="small"  v-model="searchForm.firmName"   placeholder="购方企业名称"   clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="proposer">
+        <el-input size="small"  v-model="searchForm.proposer"   placeholder="项目经理"   clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="partner">
+        <el-input size="small"  v-model="searchForm.partner"   placeholder="部门"   clearable></el-input>
+      </el-form-item>
+
+      <el-form-item
+        label="收入"
+        class="priceFormItem"
+        prop="income"
+      >
+        <el-input
+          v-model="searchForm.beginIncome"
+          onkeyup="value=value.replace(/[^\d]/g,'')"
+          class="priceInput"
+          style="width: 130px; margin-right: 10px"
+        />-<el-input
+        v-model="searchForm.endIncome"
+        class="priceInput"
+        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-form-item>
+    </el-form>
+    <div class="bg-white top">
+      <vxe-toolbar :refresh="{query: refreshList}" export print custom>
+        <template #buttons>
+          <el-row>
+            <el-upload style="float: left"
+                       class="upload-demo"
+                       :on-success="uploadSuccess"
+                       :show-file-list="false"
+                       :before-upload="beforeUpload"
+                       :action="`${$http.BASE_URL}/wuHanReimbursement/uploadFile`"
+                       multiple
+                       list-type="picture">
+              <el-button size="small"
+                         icon="el-icon-upload"
+                         type="primary">点击上传</el-button>
+            </el-upload>
+
+
+            <el-button style="margin-left: 10px" v-if="hasPermission('wuHanReimbursement: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('wuHanReimbursement:edit')" :disabled="$refs.xTree && $refs.xTree.getCheckboxRecords().length === 0" type="primary" size="small" icon="el-icon-edit" @click="editInvoiceGatheringTime()" plain>批量收款</el-button>
+
+          </el-row>
+
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 80px);">
+        <vxe-table
+          ref="xTree"
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          row-id="id"
+          size="small"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :print-config="{}"
+          :export-config="{}"
+          :tree-config="{expandAll: true}"
+          :loading="loading"
+          :checkbox-config="{labelField: ''}"
+          :data="dataList">
+          <vxe-column type="checkbox" width="40px"> </vxe-column>
+          <vxe-column  width="140px" title="业务编号"  field="businessCode"  align="left" tree-node >
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="scope.row.parentId == '0'" @click="view(scope.row.id)">{{scope.row.businessCode}}</el-link>
+              <span v-else></span>
+            </template>
+          </vxe-column>
+          <vxe-column  width="100px" title="发票代码" field="invoiceCode" align="center" visible></vxe-column>
+          <vxe-column  width="100px" title="发票号码" field="invoiceNumber" align="center">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('wuHanReimbursement:view') && scope.row.parentId !== '0'" @click="viewInvoice(scope.row.id)">{{scope.row.invoiceNumber}}</el-link>
+              <span v-else></span>
+            </template>
+          </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="income" align="center"></vxe-column>
+          <vxe-column  width="100px" title="报销比例%" field="reimbursementRatio" align="center"></vxe-column>
+          <vxe-column  width="100px"  title="状态" field="reimbursementStatus">
+            <template slot-scope="scope">
+              <el-tag type="success" v-if="scope.row.reimbursementStatus === '1'"> 已完成</el-tag>
+            </template>
+          </vxe-column>
+          <vxe-column  width="100px" title="可报金额" field="canReimbursementAmount" align="center">
+            <template slot-scope="scope">
+              <span style="font-weight: bold">{{scope.row.canReimbursementAmount}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column  width="100px" title="已报金额" field="allAlreadyReimbursementQuota" align="center">
+            <template slot-scope="scope">
+              <span style="font-weight: bold">{{scope.row.allAlreadyReimbursementQuota}}</span>
+            </template>
+          </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="partner" align="center"></vxe-column>
+          <vxe-column  width="100px" title="业务类型" field="businessType" align="center"></vxe-column>
+          <vxe-column  width="100px" title="收款日期" field="gatheringTime" align="center"></vxe-column>
+
+
+          <vxe-column title="操作" width="300px" fixed="right" align="center">
+            <template slot-scope="scope">
+              <el-button v-if="hasPermission('wuHanReimbursement: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('wuHanReimbursement:edit') && scope.row.businessCode!=='' && scope.row.parentId === '0' && scope.row.randomType === '1' " type="text" icon="el-icon-edit" size="small" @click="editBusiness(scope.row.id)">编辑业务编码</el-button>
+              <el-button v-if="hasPermission('wuHanReimbursement: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('wuHanReimbursementBusiness:add') && scope.row.businessCode !== '' && scope.row.reimbursementRatio && scope.row.parentId === '0' && scope.row.reimbursementStatus === '0'" type="text" icon="el-icon-plus" size="small" @click="addBusinessInfo(scope.row.id, scope.row.businessCode)">业务报销</el-button>
+              <el-button v-if="hasPermission('wuHanReimbursementBusiness: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('wuHanReimbursement: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('wuHanReimbursement:edit') && scope.row.parentId !== '0'" type="text" icon="el-icon-edit" size="small" @click="modifyInvoice(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('wuHanReimbursement: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('wuHanReimbursement:del') && scope.row.parentId !== '0'" type="text" icon="el-icon-delete" size="small" @click="delInvoice(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>
+    <!-- 弹窗, 新增 / 修改 -->
+    <reimbursementForm ref="reimbursementForm" @refreshDataList="refreshList"></reimbursementForm>
+    <reimbursementGatheringTimeForm ref="reimbursementGatheringTimeForm" @refreshDataList="refreshList"></reimbursementGatheringTimeForm>
+    <reimbursementRatioForm ref="reimbursementRatioForm" @refreshDataList="refreshList"></reimbursementRatioForm>
+    <reimbursementBusinessForm ref="reimbursementBusinessForm" @refreshDataList="refreshList"></reimbursementBusinessForm>
+    <reimbursementBusinessList ref="reimbursementBusinessList" @refreshDataList="refreshList"></reimbursementBusinessList>
+    <reimbursementInvoiceForm ref="reimbursementInvoiceForm" @refreshDataList="refreshList"></reimbursementInvoiceForm>
+    <reimbursementInvoiceModify ref="reimbursementInvoiceModify" @refreshDataList="refreshList"></reimbursementInvoiceModify>
+  </div>
+
+
+</template>
+<script>
+import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
+import XEUtils from 'xe-utils'
+import reimbursementForm from './wuHanReimbursementForm'
+import reimbursementGatheringTimeForm from './wuHanReimbursementGatheringTimeForm'
+import reimbursementRatioForm from './wuHanReimbursementRatioForm'
+import reimbursementInvoiceForm from './wuHanReimbursementInvoiceForm'
+import reimbursementInvoiceModify from './wuHanReimbursementInvoiceModify'
+import reimbursementBusinessForm from './wuHanReimbursementBusinessForm'
+export default {
+  data () {
+    return {
+      dataList: [],
+      searchDates: '',
+      searchForm: {
+        businessCode: '',
+        invoiceNumber: '',
+        proposer: '',
+        partner: '',
+        firmName: '',
+        reimbursementRatio: '',
+        randomType: '',
+        beginDate: '',
+        endDate: '',
+        beginIncome: '',
+        endIncome: ''
+      },
+      tablePage: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        orders: [{column: 'a.create_date', asc: false}]
+      },
+      loading: false,
+      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 = ''
+      }
+    }
+  },
+  components: {
+    reimbursementForm,
+    reimbursementGatheringTimeForm,
+    reimbursementRatioForm,
+    reimbursementInvoiceForm,
+    reimbursementInvoiceModify,
+    reimbursementBusinessForm
+  },
+  ReimbursementSys: null,
+  created () {
+    this.reimbursementSys = new ReimbursementSys()
+  },
+  activated () {
+    this.refreshList()
+  },
+  methods: {
+    // 获取数据列表
+    refreshList () {
+      this.loading = true
+      this.reimbursementSys.treeData({
+        'current': this.tablePage.currentPage,
+        'size': this.tablePage.pageSize,
+        'orders': this.tablePage.orders,
+        ...this.searchForm
+      }).then(({data}) => {
+        this.dataList = data
+        this.tablePage.total = data.total
+        this.handleSearch()
+        this.loading = false
+      })
+    },
+    beforeUpload (file) {
+      const isExcel = file.name.indexOf('.xls') >= 0 || file.name.indexOf('.xlsx') >= 0
+      const isLt2M = file.size / 1024 / 1024 < 1
+      if (!isExcel) {
+        this.$message.error('只能上传xls、xlsx文件!')
+        return false
+      }
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 10MB!')
+        return false
+      }
+      this.loading = true
+      return true
+    },
+    handleSearch () {
+      let name = XEUtils.toValueString(this.searchForm.businessCode).trim()
+      let options = { children: 'children' }
+      let searchProps = ['name']
+      this.dataList = XEUtils.searchTree(
+        this.dataList.records, item => searchProps.some(key => XEUtils.toValueString(item[key]).indexOf(name) >= -1), options)
+      this.$nextTick(() => {
+        this.$refs.xTree.setAllTreeExpand(true)
+      })
+    },
+    resetSearch () {
+      this.$refs.searchForm.resetFields()
+      this.refreshList()
+    },
+    uploadSuccess (res, file) {
+      if (res.success) {
+        this.$message.success({dangerouslyUseHTMLString: true,
+          message: res.message})
+        this.refreshList()
+      } else {
+        this.$message.error(res.message)
+        this.refreshList()
+      }
+    },
+    // 当前页
+    currentChangeHandle ({ currentPage, pageSize }) {
+      this.tablePage.currentPage = currentPage
+      this.tablePage.pageSize = pageSize
+      this.refreshList()
+    },
+    // 修改
+    editBusiness (id) {
+      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/wuHanReimbursementBusinessList`, query: {id: id, title: '业务报销详情'}})
+    },
+    // 修改发票收款日期
+    editInvoiceGatheringTime (id) {
+      let ids = id || this.$refs.xTree.getCheckboxRecords().map(item => {
+        return item.id
+      }).join(',')
+      this.$refs.reimbursementGatheringTimeForm.init('edit', {id: ids, parent: {id: '', name: ''}})
+    },
+    // 修改发票信息
+    editInvoice (id) {
+      this.$refs.reimbursementInvoiceForm.init('editInvoice', {id: id, parent: {id: '', name: ''}})
+    },
+    // 修改发票信息
+    modifyInvoice (id) {
+      this.$refs.reimbursementInvoiceModify.init('modifyInvoice', {id: id, parent: {id: '', name: ''}})
+    },
+    // 查看
+    view (id) {
+      this.$refs.reimbursementForm.init('view', {id: id, parent: {id: '', name: ''}})
+    },
+    // 查看发票信息
+    viewInvoice (id) {
+      this.$refs.reimbursementInvoiceForm.init('viewInvoice', {id: id, parent: {id: '', name: ''}})
+    },
+    // 删除
+    delBusiness (id) {
+      let ids = id || this.$refs.xTree.getCheckboxRecords().map(item => {
+        return item.id
+      }).join(',')
+      this.$confirm(`确定删除该记录吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.reimbursementSys.deleteBusiness(ids).then(({data}) => {
+          this.loading = false
+          this.$message({
+            message: data,
+            type: 'success',
+            duration: 1500
+          })
+          this.refreshList()
+        })
+      })
+    },
+    // 删除
+    delInvoice (id) {
+      let ids = id || this.$refs.xTree.getCheckboxRecords().map(item => {
+        return item.id
+      }).join(',')
+      this.$confirm(`确定删除该记录吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.reimbursementSys.deleteInvoice(ids).then(({data}) => {
+          this.loading = false
+          this.$message({
+            message: data,
+            type: 'success',
+            duration: 1500
+          })
+          this.refreshList()
+        })
+      })
+    },
+    // 删除
+    del (id) {
+      let ids = id || this.$refs.xTree.getCheckboxRecords().map(item => {
+        return item.id
+      }).join(',')
+      this.$confirm(`确定删除该记录吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.reimbursementSys.delete(ids).then(({data}) => {
+          this.loading = false
+          this.$message({
+            message: data,
+            type: 'success',
+            duration: 1500
+          })
+          this.refreshList()
+        })
+      })
+    }
+  }
+
+}
+</script>

+ 129 - 0
src/views/modules/reimbursementSys/wuHanReimbursementRatioForm.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/wuHanReimbursementSysService'
+  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>