|
<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="出差人" prop="travelers">
|
<el-input v-model="queryParams.travelers" placeholder="请输入出差人" clearable size="small"
|
@keyup.enter.native="handleQuery" />
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="6">
|
<el-form-item label="报销人" prop="username">
|
<el-input v-model="queryParams.username" placeholder="请输入报销人" clearable size="small"
|
@keyup.enter.native="handleQuery" />
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="6">
|
<el-form-item label="审核状态" prop="recordstatus">
|
<el-input v-model="queryParams.recordstatus" placeholder="请选择审核状态" clearable size="small" v-if="0"
|
@keyup.enter.native="handleQuery" />
|
<el-select v-model="queryParams.recordstatus" placeholder="请选择审核状态" clearable size="small">
|
<el-option v-for="dict in dict.type.sys_recordstatus" :key="dict.value" :label="dict.label"
|
:value="dict.value" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="报销日期" prop="createTime">
|
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="value1" type="daterange" @blur="onpick"
|
range-separator="至" start-placeholder="报销开始日期" end-placeholder="报销结束日期" @keyup.enter.native="handleQuery">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="6">
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
<!-- v-hasPermi="['project:funddetail:add']" -->
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading"
|
@click="handleExport">导出</el-button>
|
</el-col>
|
<!-- v-hasPermi="['project:funddetail:export']" -->
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
</el-row>
|
|
<el-table border v-loading="loading" :data="reimbursementList" @selection-change="handleSelectionChange">
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<el-table-column label="记录状态" align="center" prop="recordstatus" width="180">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.sys_recordstatus" :value="scope.row.recordstatus" />
|
</template>
|
</el-table-column>
|
<el-table-column label="报销人类别" width="120" align="center" prop="costtype">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.sys_travelexpensebelong" :value="scope.row.costtype" />
|
</template>
|
</el-table-column>
|
<el-table-column label="申请时间" width="120" align="center" prop="createTime">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="报销人" width="120" align="center" prop="username">
|
</el-table-column>
|
<el-table-column label="出差人" width="180" align="center" prop="travelers">
|
</el-table-column>
|
<el-table-column label="报销金额" width="120" align="center" prop="amountrequested">
|
</el-table-column>
|
<el-table-column label="出差事由" align="center" width="280" prop="reason">
|
</el-table-column>
|
<el-table-column label="联系电话" width="120" align="center" prop="phone">
|
</el-table-column>
|
<el-table-column label="开户银行" width="180" align="center" prop="depositbank">
|
</el-table-column>
|
<el-table-column label="银行卡号" width="180" align="center" prop="bankcardno">
|
</el-table-column>
|
<!-- <el-table-column label="报销合计" align="center" prop="financechecher"/>-->
|
<!-- <el-table-column label="财务审核" width="120" align="center" prop="financechecher" /> -->
|
<el-table-column label="捐献者" width="120" align="center" prop="donorname">
|
</el-table-column>
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="270">
|
<template slot-scope="scope">
|
<el-button v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1" size="mini" type="text"
|
icon="el-icon-upload2" @click="handleup(scope.row)">上报</el-button>
|
<el-button v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1" size="mini" type="text"
|
icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)">查看</el-button>
|
<!-- v-hasPermi="['project:funddetail:edit']" -->
|
<el-button size="mini" type="text" icon="el-icon-download" @click="gettable(scope.row)">
|
下载
|
</el-button>
|
<!-- v-hasPermi="['project:funddetail:edit']" -->
|
<el-button v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1" size="mini" type="text"
|
icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
<!-- v-hasPermi="['project:funddetail:remove']" -->
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- v-hasPermi="['project:donateconsolationfund:edit']" -->
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
@pagination="getList" />
|
|
<!-- 添加或修改费用申请明细对话框 -->
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="1400px" append-to-body
|
@close="reset">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-row><el-col :span="5">
|
<el-form-item label="申请日期" prop="createTime">
|
<el-date-picker style="width: 100%" v-model="form.createTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="申请日期">
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="经办人" prop="username">
|
<el-select v-model="form.username" clearable filterable allow-create ref="getReportname"
|
default-first-option placeholder="请选择">
|
<el-option v-for="item in reporters" :key="item.reportNo" :label="item.reportName"
|
:value="item.reportName">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col><el-col :span="5">
|
<el-form-item label="区域组长" prop="managername">
|
<el-input v-model="form.managername" placeholder="区域组长" />
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="5">
|
<el-form-item label="捐献者" prop="infoid">
|
<el-select v-model="form.infoid" @change="selectbaseinfo" filterable placeholder="请选择捐献者">
|
<el-option v-for="item in baselist" :key="item.index" :label="item.name" :value="item.infoid">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px">
|
<el-col :span="5">
|
<el-form-item label="报销金额" prop="amountrequested">
|
<el-input :disabled="true" v-model="form.amountrequested" placeholder="报销合计金额" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="大写金额" prop="bigstrmoney">
|
<el-input :disabled="true" v-model="form.bigstrmoney" placeholder="报销大写金额" />
|
</el-form-item>
|
</el-col><el-col :span="5">
|
<el-form-item label="审核状态" prop="flowlevel">
|
<el-select v-model="form.recordstatus" placeholder="请选择审核状态" clearable :disabled="true" size="small">
|
<el-option v-for="dict in dict.type.sys_recordstatus" :key="dict.value" :label="dict.label"
|
:value="dict.value" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<!--
|
<el-row>
|
<el-col :span="15">
|
<el-form-item label="出差事由" prop="reason">
|
<el-input v-model="form.reason" placeholder="出差事由" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="报销分类" prop="costtype">
|
<el-select v-model="form.costtype" value-key="value" placeholder="请选择出差人分类" @change="getTravelers">
|
<el-option v-for="dict in dict.type.sys_travelexpensebelong" :key="dict.value" :label="dict.label"
|
:value="dict.value"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="报销人" prop="travelers">
|
<el-select v-model="form.travelers" clearable filterable allow-create ref="getReportname"
|
default-first-option placeholder="请选择" @change="selectedTraveler">
|
<el-option v-for="item in travelers" :key="item.reportNo" :label="item.reportName"
|
:value="item.reportName">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="收款银行" prop="depositbank">
|
<el-input v-model="form.depositbank" placeholder="开户银行" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="银行账号" prop="bankcardno">
|
<el-input v-model="form.bankcardno" placeholder="开户银行" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="联系电话" prop="phone">
|
<el-input v-model="form.phone" placeholder="联系电话" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="20"><el-divider></el-divider></el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="5">
|
<el-form-item label="家属费用" prop="donoramount">
|
<el-input :disabled="true" v-model="form.donoramount" placeholder="家属费用" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" onchange="if(/[^0-9.]/.test(this.value)){alert('请正确输入整数数字或小数!');this.value='';}" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="15">
|
<el-form-item label="费用说明" prop="donorremark">
|
<el-input :disabled="true" v-model="form.donorremark" placeholder="家属费用说明" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="5">
|
<el-form-item label="家属人数" prop="donorrelatives">
|
<el-input v-model="form.donorrelatives" placeholder="家属人数" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="收款人" prop="donorpayee">
|
<el-input v-model="form.donorpayee" placeholder="亲属收款人" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="收款银行" prop="donorbank">
|
<el-input v-model="form.donorbank" placeholder="家属银行" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="银行卡号" prop="donorbankcard">
|
<el-input v-model="form.donorbankcard" placeholder="银行卡号" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
-->
|
<!--
|
<el-row type="flex" :gutter="10" align="right" class="mb8">
|
<el-col :span="6">
|
<el-button
|
type="primary"
|
plain
|
icon="el-icon-plus"
|
size="mini"
|
@click="addRow"
|
>新增一行</el-button
|
>
|
</el-col>
|
</el-row>
|
-->
|
<el-row>
|
<el-table :data="applicationDetailArr" border highlight-current-row>
|
<el-table-column prop="orderno" slot="" label="序号" align="center" fixed width="65">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.orderno" placeholder="序号" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="persontype" slot="" label="人员类别" align="center" fixed width="120">
|
<template slot-scope="scope">
|
<el-select v-model="form.persontype" value-key="value" placeholder="人员类别" @change="getTravelers">
|
<el-option v-for="dict in dict.type.sys_travelexpensebelong" :key="dict.value" :label="dict.label"
|
:value="dict.value"></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column prop="personname" slot="" label="出差人" align="center" fixed width="120">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.personname" placeholder="出差人" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="starttime" slot="" label="开始日期" fixed align="center" width="150">
|
<template slot-scope="scope">
|
<el-date-picker :picker-options="{
|
disabledDate: time => {
|
if (scope.row.endtime) { return time.getTime() > new Date(scope.row.endtime.replace(/-/g, '/')) }
|
}
|
}" clearable size="small" style="width: 100%" v-model="scope.row.starttime" type="date"
|
value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始日期" @blur="getallowance(scope.row)">
|
</el-date-picker>
|
</template>
|
</el-table-column>
|
<el-table-column prop="endtime" slot="" label="结束日期" align="center" fixed width="150">
|
<template slot-scope="scope">
|
<el-date-picker :picker-options="{
|
disabledDate: time => {
|
if (scope.row.starttime) { return time.getTime() < new Date(scope.row.starttime.replace(/-/g, '/')) }
|
}
|
}" clearable size="small" style="width: 100%" v-model="scope.row.endtime" type="date"
|
value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束日期" @blur="getallowance(scope.row)">
|
</el-date-picker>
|
</template>
|
</el-table-column>
|
<el-table-column prop="departure" slot="" label="出发地" align="center" fixed width="100">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.departure" placeholder="出发地" />
|
</template>
|
</el-table-column>
|
<el-table-column label="到达地" prop="destination" align="center" fixed width="100">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.destination" placeholder="到达地" @blur="getallowance(scope.row)" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="days" label="天数" width="65" align="center">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.days" @blur="getStandard(scope.row)" placeholder="天数" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="traffictype" label="出发交通工具" align="center" width="100">
|
<template slot-scope="scope">
|
<el-select v-model="scope.row.traffictype" placeholder="出发交通工具">
|
<el-option v-for="dict in dict.type.sys_traffictype" :key="dict.value" :label="dict.label"
|
:value="dict.label"></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column prop="traffictype2" label="返回交通工具" align="center" width="100">
|
<template slot-scope="scope">
|
<el-select v-model="scope.row.traffictype2" placeholder="返回交通工具">
|
<el-option v-for="dict in dict.type.sys_traffictype" :key="dict.value" :label="dict.label"
|
:value="dict.label"></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column prop="trafficexpense" label="交通费" align="center" width="80">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.trafficexpense" placeholder="交通费" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
<!--
|
<el-table-column prop="cityfee" label="市内交通费" align="center" width="100">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.cityfee" placeholder="市内交通费" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
">{{ Number(scope.row.cityfee).toFixed(2) }}
|
</el-input>
|
</template>
|
</el-table-column>
|
-->
|
<el-table-column prop="hotelexpense" label="住宿费" align="center" width="80">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.hotelexpense" placeholder="住宿费" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="foodexpenses" label="餐费报销" align="center" width="80">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.foodexpenses" placeholder="伙食费报销" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="foodallowance" label="伙食补助" align="center" width="80">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.foodallowance" placeholder="伙食费补助" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="otherexpense" label="公杂费补助" align="center" width="80">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.otherexpense" placeholder="杂费" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="otherfeeamount" label="其他费用" align="center" width="90">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.otherfeeamount" placeholder="其他费用" @blur="
|
(val) => {
|
sumTotalFee();
|
}
|
" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="departure" slot="" label="其他费用说明" align="center" width="120">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.otherfeedesc" placeholder="其他费用说明" />
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="total" label="合计" align="center" width="110">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.total" placeholder="合计" />
|
</template>
|
</el-table-column>
|
<el-table-column fixed="right" label="操作" align="center" width="120" v-if="dialogType == 'edit'">
|
<template slot-scope="scope">
|
<el-button type="text" size="mini" @click="addRow(scope.$index)">新增</el-button>
|
<el-button @click.native.prevent="
|
deleteRow(scope.$index, applicationDetailArr, scope.row)
|
" type="text" size="small">
|
删除
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-row>
|
|
<!--
|
<el-row>
|
<el-col :span="7">
|
<el-form-item label="中心负责人" prop="opochecker">
|
<el-input v-model="form.opochecker" placeholder="中心负责人" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="财务副院长" prop="finvicepresident">
|
<el-input v-model="form.finvicepresident" placeholder="财务副院长" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="业务副院长" prop="busvicepresident">
|
<el-input v-model="form.busvicepresident" placeholder="业务副院长" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="7">
|
<el-form-item label="办公室主任" prop="officedirector">
|
<el-input v-model="form.officedirector" placeholder="办公室主任" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="财务部主任" prop="financedirector">
|
<el-input v-model="form.financedirector" placeholder="财务部主任" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
-->
|
<el-row>
|
<el-col :span="14">
|
<!--
|
<el-form-item label="文件地址" prop="fileurl">
|
<el-input v-model="form.fileurl" placeholder="请输入文件地址" />
|
</el-form-item>
|
-->
|
<el-form-item label="文件上传" align="left" prop="annexfiles">
|
<!-- <file-upload ref="fileUpload" :fileType=fileType :limit="1" :on-success="handleUploadSuccess"></file-upload> -->
|
<el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileList" multiple :limit="5"
|
:headers="headers" :on-success="
|
(response, file, fileList) =>
|
uploadSccess(response, file, fileList)
|
" :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="handleUploadError"
|
:on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
|
<el-button :disabled='dialogType == "detail"' size="small" type="primary">上传</el-button>
|
</el-upload>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row v-if="dialogType == 'detail'">
|
<el-table :data="fundflowList" border>
|
<el-table-column label="审核人" align="center" width="120" prop="checkusername" />
|
<el-table-column label="审核日期" align="center" width="160" prop="createTime" />
|
<el-table-column label="审核结果" align="center" width="200" prop="flowconclusion"><template
|
slot-scope="scope"><span v-if="scope.row.flowconclusion == 1">通过</span><span
|
v-if="scope.row.flowconclusion == 2">不通过</span></template>
|
</el-table-column>
|
<el-table-column label="审核备注" align="center" prop="flowcontent" />
|
</el-table>
|
</el-row>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="submitForm" v-if="dialogType == 'edit'">保 存</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { listDonatebaseinfo } from "@/api/project/donatebaseinfo";
|
import {
|
listReimbursement,
|
getReimbursement,
|
delReimbursement,
|
addReimbursement,
|
updateReimbursement,
|
exportReimbursement,
|
getdownload,
|
//获取地市对应基准金额
|
getstandardRMB,
|
fundSubmit,
|
} from "@/api/project/reimbursement";
|
import {
|
addReimbursementdetail,
|
updateReimbursementdetail,
|
listReimbursementdetailid,
|
getReimbursementdetaillist,
|
delReimbursementdetail,
|
delReimbursementdetailrbid,
|
getTravelStandard,
|
} from "@/api/project/reimbursementdetail";
|
import { listFundflow } from "@/api/project/fundflow";
|
import { getInfoBytheUserNo } from "@/api/project/externalperson";
|
import { regionDataPlus, CodeToText } from "element-china-area-data";
|
import Li_area_select from "@/components/Address";
|
import { getUserProfile } from "@/api/system/user";
|
import {
|
listOrganization,
|
getOrganization,
|
listReportname,
|
listUser,
|
} from "@/api/project/organization";
|
import { getToken } from "@/utils/auth";
|
export default {
|
components: {
|
Li_area_select,
|
},
|
name: "Funddetail",
|
dicts: [
|
"sys_finsubject",
|
"sys_0_1",
|
"sys_fund_type",
|
"sys_financeitemtype",
|
"sys_recordstatus",
|
"sys_travelexpensebelong",
|
"sys_traffictype",
|
],
|
data() {
|
return {
|
reporters: [],
|
travelers: [],
|
costtypeobj: {
|
value: 0,
|
label: "",
|
},
|
userlist: [],
|
options: regionDataPlus,
|
selectedOptions: [],
|
searchAddress: {
|
sheng: "",
|
shi: "",
|
qu: "",
|
},
|
value1: "",
|
// 遮罩层
|
loading: true,
|
// 导出遮罩层
|
exportLoading: false,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 费用申请明细表格数据
|
funddetailList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
itemname: null,
|
itemtype: null,
|
starttime: null,
|
remark: null,
|
departure: null,
|
endtime: null,
|
destination: null,
|
uploadFlag: null,
|
uploadTime: null,
|
orderByColumn: "createTime",
|
isAsc: "desc",
|
},
|
// 表单参数
|
form: {},
|
reimbursementList: [],
|
// 表单校验
|
rules: {
|
costtype: [
|
{ required: true, message: "请选择报销归类", trigger: "blur" },
|
],
|
username: [
|
{ required: true, message: "请选择填报人", trigger: "blur" },
|
],
|
travelers: [
|
{ required: true, message: "请选择报销人", trigger: "blur" },
|
],
|
reason: [
|
{ required: true, message: "请输入出差事由", trigger: "blur" },
|
],
|
},
|
//费用申请单form
|
applicationForm: {
|
applicationType: null,
|
donorno: null,
|
donorname: null,
|
bigstrmoney: null,
|
},
|
applicationDetailArr: [],
|
arrr2: [],
|
baselist: [],
|
balist: [],
|
standardlevel: 0,
|
defaultperson: {},
|
fundflowList: [],
|
showApproveRecordDialog: false,
|
dialogType: "edit",
|
|
//上传发票文件路径
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
|
//文件列表
|
fileList: [],
|
|
headers: {
|
Authorization: "Bearer " + getToken(),
|
},
|
};
|
},
|
created() {
|
this.getList();
|
this.getlistUser();
|
this.selectReporters();
|
},
|
mounted() {
|
listDonatebaseinfo().then((res) => {
|
// console.log("base基础表数据", res.rows);
|
let list = res.rows;
|
let baseinfolist = [];
|
this.balist = list;
|
list.forEach((element) => {
|
baseinfolist.push({
|
infoid: element.id,
|
name: element.name,
|
});
|
});
|
// console.log("组合的新数组", baseinfolist);
|
if (baseinfolist != 0) {
|
this.baselist = baseinfolist;
|
}
|
});
|
this.getUsermsg();
|
},
|
methods: {
|
handleUploadError() { },
|
remove(file) {
|
|
this.fileList.splice(this.fileList.indexOf(file), 1)
|
|
},
|
handleExceed() {
|
this.$message.error(`上传文件数量不能超过 ${5} 个!`);
|
},
|
//文件上传成功回调
|
uploadSccess(response, file, fileList) {
|
//获取附件信息位置
|
if (response.code == 200) {
|
this.form.filename = file.raw.name;
|
//console.log(file);
|
this.$modal.msgSuccess(response.msg);
|
this.fileList.push({ name: response.fileName, url: response.fileName });
|
} else {
|
this.$modal.msgError(response.msg);
|
}
|
},
|
selectReporters() {
|
//专家人员列表
|
let arr = ["xty1", "zzry", "fzr"];
|
let arrreportlist = [];
|
for (let i = 0; i < arr.length; i++) {
|
this.arrr2 = [];
|
listReportname(arr[i]).then((res) => {
|
this.arrr2 = res.data;
|
this.reporters = this.reporters.concat(this.arrr2);
|
// console.log("adadadadasdsad", this.reporters);
|
});
|
}
|
},
|
|
//获取出差人列表
|
getTravelers() {
|
//专职人员-1,协调员-2,专家-3,家属-4,其他人员-5
|
let travelertype = "";
|
if (this.form.costtype == 1) {
|
travelertype = "zzry";
|
} else if (this.form.costtype == 2) {
|
travelertype = "xty1";
|
} else if (this.form.costtype == 3) {
|
travelertype = "expert";
|
} else if (this.form.costtype == 4) {
|
travelertype = "jiashu";
|
} else if (this.form.costtype == 5) {
|
travelertype = "fzr";
|
}
|
|
listReportname(travelertype).then((res) => {
|
this.travelers = res.data;
|
});
|
},
|
|
selectcosttype() {
|
this.form.costtype = this.costtypeobj.value;
|
this.form.costtypename = this.costtypeobj.label;
|
},
|
|
getUsermsg() {
|
getUserProfile().then((response) => {
|
this.defaultperson = response.data;
|
this.standardlevel = response.data.standardlevel;
|
});
|
},
|
getlistUser() {
|
listUser().then((res) => {
|
this.userlist = res.data;
|
});
|
},
|
selectedTraveler() {
|
this.travelers.map((res) => {
|
if (res.reportName == this.form.travelers) {
|
getInfoBytheUserNo(res.reportNo).then((res) => {
|
this.form.depositbank = res.data.depositbank;
|
this.form.bankcardno = res.data.bankcardno;
|
this.form.phone = res.data.telephone;
|
});
|
}
|
});
|
},
|
//计算补助
|
getallowance(row) {
|
if (
|
row.starttime != "" &&
|
row.starttime != null &&
|
row.endtime != "" &&
|
row.endtime != null
|
) {
|
//计算天数
|
row.days = 1 + Math.floor(Math.abs(Date.parse(row.starttime) - Date.parse(row.endtime)) / (1099 * 3699 * 24))
|
|
/*let aDate, oDate1, oDate2, Date_end,Date_start;
|
Date_end = row.endtime.split(" "); //将时间以空格划分为两个数组 第一个数组是 2019-05-20 第二个数组是 00:00:00
|
aDate = Date_end[0].split("-"); //获取第一个数组的值
|
oDate1 = new Date(aDate[0], aDate[1], aDate[2]); //将前半个数组以-拆分,每一个是一个数值
|
|
Date_start = row.starttime.split(" ");
|
aDate = Date_start[0].split("-");
|
oDate2 = new Date(aDate[0], aDate[1], aDate[2]);
|
row.days = 1+parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
|
*/
|
} else {
|
row.days = ''
|
};
|
|
//公杂费补助:杭州桐庐,建德,淳安60,杭州其他地区0,非杭州地区80
|
if (row.destination != "") {
|
var str = row.destination;
|
//验证城市
|
////if (str.indexOf("桐庐,建德,淳安") !== -1) { };
|
if (str.includes("杭州")) { row.otherexpense = parseInt(row.days) * 0 }
|
else if (str.includes("桐庐") || str.includes("建德") || str.includes("淳安")) { row.otherexpense = parseInt(row.days) * 60 }
|
else { row.otherexpense = parseInt(row.days) * 80 };
|
}
|
|
//伙食费补助:城市(西藏,新疆,青海.120)(其他100)
|
row.foodallowance = parseInt(row.days) * 100
|
|
//计算合计
|
this.sumTotalFee();
|
},
|
|
getStandard(row) {
|
if (
|
row.searchAddress.sheng != "" &&
|
row.searchAddress.shi != "" &&
|
row.searchAddress.qu != "" &&
|
row.starttime != "" &&
|
row.starttime != null &&
|
row.days != ""
|
) {
|
//计算住宿费
|
let info = {
|
pabegindate: this.$moment(row.starttime).format("YYYY-MM-DD"),
|
pacitycode: this.$refs["residenceSelect_" + row.index].getShi(),
|
paenddate: this.$moment(row.starttime)
|
.add(row.days, "day")
|
.format("YYYY-MM-DD"),
|
paprovincecode: this.$refs["residenceSelect_" + row.index].getSheng(),
|
patowncode: this.$refs["residenceSelect_" + row.index].getQu(),
|
standardlevel: this.standardlevel,
|
};
|
getTravelStandard(info)
|
.then((response) => {
|
let fee = 0;
|
for (let i = 0; i < response.data.length; i++) {
|
fee += response.data[i].reimbursementamout;
|
}
|
row.hotelexpense = fee;
|
})
|
.finally(() => {
|
this.sumTotalFee(row);
|
});
|
}
|
},
|
selcetdestination(row) {
|
console.log("目的地选择事件", row, row.searchAddress);
|
//row.searchAddress = this.searchAddress;
|
if (
|
row.searchAddress.sheng != "" &&
|
row.searchAddress.shi != "" &&
|
row.searchAddress.qu != ""
|
) {
|
row.destination =
|
row.searchAddress.sheng +
|
row.searchAddress.shi +
|
row.searchAddress.qu;
|
row.travelprovincename = row.searchAddress.sheng;
|
row.travelprovince =
|
this.$refs["residenceSelect_" + row.index].getSheng();
|
row.travelcityname = row.searchAddress.shi;
|
row.travelcity = this.$refs["residenceSelect_" + row.index].getShi();
|
row.traveltownname = row.searchAddress.qu;
|
row.traveltown = this.$refs["residenceSelect_" + row.index].getQu();
|
this.getStandard(row);
|
}
|
},
|
|
getCodeToText(codeArray) {
|
// 参数 codeStr,
|
// if (null === codeStr && null === codeArray) {
|
// return null;
|
// } else if (null === codeArray) {
|
// codeArray = codeStr.split(",");
|
// }
|
|
let area = "";
|
switch (codeArray.length) {
|
case 1:
|
area += CodeToText[codeArray[0]];
|
break;
|
case 2:
|
area += CodeToText[codeArray[0]] + "/" + CodeToText[codeArray[1]];
|
break;
|
case 3:
|
area +=
|
CodeToText[codeArray[0]] +
|
"/" +
|
CodeToText[codeArray[1]] +
|
"/" +
|
CodeToText[codeArray[2]];
|
break;
|
default:
|
break;
|
}
|
return area;
|
},
|
|
selectbaseinfo() {
|
let list = this.balist;
|
list.forEach((item) => {
|
if (item.id == this.form.infoid) {
|
// console.log('相同的',item.id,item)
|
this.form.donorno = item.donorno;
|
this.form.donorname = item.name;
|
}
|
});
|
},
|
|
onpick(e) {
|
// console.log(e,this.value1)
|
},
|
|
gettable(e) {
|
const id = e.id;
|
getdownload(e.id).then((res) => {
|
var fileUrl = res;
|
//获取当前网址
|
var urlBase = process.env.VUE_APP_BASE_API;
|
var curWWWPath = window.document.location.href;
|
var pos = curWWWPath.indexOf(window.document.location.pathname);
|
// 创建a标签
|
var aEle = document.createElement("a");
|
aEle.href =
|
curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
|
aEle.click();
|
});
|
|
// downloadconfirmationinfo(id).then((response) => {
|
// var fileUrl = response;
|
// //获取当前网址
|
// var urlBase = process.env.VUE_APP_BASE_API;
|
// var curWWWPath = window.document.location.href;
|
// var pos = curWWWPath.indexOf(window.document.location.pathname);
|
// // 创建a标签
|
// var aEle = document.createElement("a");
|
// aEle.href =
|
// curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
|
// aEle.click();
|
// });
|
},
|
|
/** 查询报销申请列表 */
|
getList() {
|
this.loading = true;
|
listReimbursement(this.queryParams).then((response) => {
|
console.log("差旅费数据列表:", response);
|
this.reimbursementList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
|
},
|
// 表单重置
|
reset() {
|
|
this.fileList = []
|
this.form = {
|
ceshi: {},
|
bigstrmoney: null,
|
id: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
userno: null,
|
username: null,
|
idcardtype: null,
|
idcardno: null,
|
phone: null,
|
depositbank: null,
|
bankcardno: null,
|
branchbankname: null,
|
annexbankcard: null,
|
annexfiles: null,
|
amountrequested: null,
|
prepaidamount: null,
|
invoicecount: null,
|
attachcount: null,
|
managerno: null,
|
managername: null,
|
deptmentno: null,
|
deptmentname: null,
|
opochecker: null,
|
finvicepresident: null,
|
busvicepresident: null,
|
officedirector: null,
|
financedirector: null,
|
financechecher: null,
|
infoid: null,
|
donorno: null,
|
bigstrmoney: null,
|
remark: null,
|
reason: null,
|
recordstatus: "-1",
|
uploadflag: null,
|
uploadtime: null,
|
costtype: null,
|
costtypename: null,
|
};
|
this.applicationDetailArr = [];
|
this.resetForm("form");
|
},
|
//
|
handup(e) {
|
console.log("上报", e);
|
},
|
// 下载文件
|
downFile(item) {
|
const url = process.env.VUE_APP_BASE_API + item.url
|
var a = document.createElement('a');
|
var event = new MouseEvent('click');
|
a.download = item.name;
|
a.href = url;
|
a.dispatchEvent(event);
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
// console.log('pop',this.value1)
|
if (this.value1.length > 0) {
|
this.queryParams.starttime = this.value1[0] + " 00:00:00";
|
this.queryParams.endtime = this.value1[1] + " 00:00:00";
|
console.log("开始时间", this.queryParams.starttime);
|
}
|
// this.queryParams.pacitycode= this.$refs["residenceSelect"].getShi();
|
// this.queryParams.paprovincecode= this.$refs["residenceSelect" ].getSheng();
|
// this.queryParams.patowncode= this.$refs["residenceSelect" ].getQu();
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map((item) => item.id);
|
this.single = selection.length !== 1;
|
this.multiple = !selection.length;
|
},
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.dialogType = "edit";
|
this.fundflowList = [];
|
this.form.username = this.defaultperson.nickName;
|
this.form.userno = this.defaultperson.userName;
|
this.addRow();
|
this.open = true;
|
this.title = "添加报销申请";
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.dialogType = "edit";
|
this.reset();
|
const id = row.id || this.ids;
|
getReimbursement(id).then((response) => {
|
this.form = response.data;
|
this.fileList = this.form.annexfiles ? this.form.annexfiles.split(",").map(item => ({ url: item, name: item })) : []
|
this.form.recordstatus = response.data.recordstatus + "";
|
this.open = true;
|
this.title = "修改报销申请";
|
let ids = response.data.id;
|
|
getReimbursementdetaillist(ids).then((res) => {
|
this.applicationDetailArr = res.data;
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
this.applicationDetailArr[i].index = i;
|
this.applicationDetailArr[i].searchAddress = {
|
sheng: this.applicationDetailArr[i].travelprovincename,
|
shi: this.applicationDetailArr[i].travelcityname,
|
qu: this.applicationDetailArr[i].traveltownname,
|
};
|
}
|
this.sumTotalFee();
|
});
|
});
|
},
|
/** 查看按钮操作 */
|
handleDetail(row) {
|
this.dialogType = "detail";
|
this.reset();
|
const id = row.id || this.ids;
|
getReimbursement(id).then((response) => {
|
this.form = response.data;
|
this.fileList = this.form.annexfiles ? this.form.annexfiles.split(",").map(item => ({ url: item, name: item })) : []
|
|
this.form.recordstatus = response.data.recordstatus + "";
|
this.open = true;
|
this.title = "查看报销申请";
|
let ids = response.data.id;
|
let listFundflowparams = {
|
fundid: row.id,
|
fundtype: 1,
|
};
|
listFundflow(listFundflowparams).then((res) => {
|
this.fundflowList = res.rows;
|
});
|
getReimbursementdetaillist(ids).then((res) => {
|
this.applicationDetailArr = res.data;
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
this.applicationDetailArr[i].index = i;
|
this.applicationDetailArr[i].searchAddress = {
|
sheng: this.applicationDetailArr[i].travelprovincename,
|
shi: this.applicationDetailArr[i].travelcityname,
|
qu: this.applicationDetailArr[i].traveltownname,
|
};
|
}
|
//this.sumTotalFee();
|
});
|
});
|
},
|
/** 提交按钮 */
|
submitForm() {
|
this.$refs["form"].validate((valid) => {
|
if (valid) {
|
let indexErrTime = this.applicationDetailArr.findIndex((item) => {
|
if (item.endtime && item.starttime) {
|
let d = this.$moment(item.endtime).diff(
|
this.$moment(item.starttime),
|
"d"
|
);
|
if (d < 0) {
|
return true;
|
} else {
|
return false;
|
}
|
} else {
|
false;
|
}
|
});
|
|
if (indexErrTime > -1) {
|
this.$message({
|
message: "第" + (indexErrTime + 1) + "行到达日期早于出发日期",
|
type: "warning",
|
});
|
return;
|
}
|
|
let emptyStartTimeindex = this.applicationDetailArr.findIndex(
|
(item) =>
|
item.starttime == null ||
|
item.starttime == undefined ||
|
item.starttime == ""
|
);
|
|
if (emptyStartTimeindex > -1) {
|
this.$message({
|
message: "第" + (emptyStartTimeindex + 1) + "行出发日期为空",
|
type: "warning",
|
});
|
return;
|
}
|
|
let emptyEndTimeindex = this.applicationDetailArr.findIndex(
|
(item) =>
|
item.endtime == null ||
|
item.endtime == undefined ||
|
item.endtime == ""
|
);
|
|
if (emptyEndTimeindex > -1) {
|
this.$message({
|
message: "第" + (emptyEndTimeindex + 1) + "行到达日期为空",
|
type: "warning",
|
});
|
return;
|
}
|
|
let belongArr = this.dict.type.sys_travelexpensebelong;
|
let costtypeindex = belongArr.findIndex(
|
(item) => this.form.costtype == item.value
|
);
|
let list = this.fileList;
|
if (list.length > 0) {
|
this.form.annexfiles = list.map(item => item.url).join(",");
|
}
|
if (costtypeindex > -1) {
|
this.form.costtypename = belongArr[costtypeindex].label;
|
}
|
if (this.form.id != null) {
|
updateReimbursement(this.form).then((response) => {
|
// console.log('更新主表的信息',response);
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
if (this.applicationDetailArr[i].rbid != null) {
|
updateReimbursementdetail(this.applicationDetailArr[i]);
|
} else {
|
this.applicationDetailArr[i].rbid = this.form.id;
|
addReimbursementdetail(this.applicationDetailArr[i]);
|
}
|
}
|
this.$modal.msgSuccess("修改成功");
|
this.open = false;
|
this.getList();
|
});
|
} else {
|
this.form.recordstatus = -1;
|
const applicationDetailArr = [...this.applicationDetailArr]
|
addReimbursement(this.form).then((response) => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getList();
|
console.log(
|
"主表新增成功了:",
|
response,
|
this.applicationDetailArr
|
);
|
listReimbursementdetailid().then((res) => {
|
let id = res.data;
|
for (let i = 0; i < applicationDetailArr.length; i++) {
|
applicationDetailArr[i].rbid = id;
|
|
addReimbursementdetail(applicationDetailArr[i]);
|
}
|
});
|
});
|
}
|
}
|
});
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const ids = row.id || this.ids;
|
this.$modal
|
.confirm("是否确认删除该条记录?")
|
.then(function () {
|
// 删除details内的数据
|
return delReimbursement(ids);
|
})
|
.then(() => {
|
delReimbursementdetail(ids);
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
})
|
.catch(() => { });
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
const queryParams = this.queryParams;
|
this.$modal
|
.confirm("是否确认导出所有报销申请数据项?")
|
.then(() => {
|
this.exportLoading = true;
|
return exportReimbursement(queryParams);
|
})
|
.then((response) => {
|
this.$download.name(response.msg);
|
this.exportLoading = false;
|
})
|
.catch(() => { });
|
},
|
|
//新增一行
|
addRow(rowIndex) {
|
let rowData = {
|
//index: this.applicationDetailArr.length,
|
searchAddress: {
|
sheng: "",
|
shi: "",
|
qu: "",
|
},
|
id: null,
|
rbid: null,
|
starttime: null,
|
departure: null,
|
endtime: null,
|
destination: null,
|
days: null,
|
trafficexpense: 0,
|
traffictype: null,
|
cityfee: 0,
|
hotelexpense: 0,
|
invoicecount: null,
|
attachcount: null,
|
otherexpense: 0,
|
foodexpenses: 0,
|
foodallowance: 0,
|
otherfeeamount: 0,
|
annexfiles: null,
|
remark: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
uploadFlag: null,
|
uploadTime: null,
|
total: 0,
|
orderno: null,
|
};
|
if (rowIndex == undefined || rowIndex == null || rowIndex < 0) {
|
this.applicationDetailArr.push(rowData);
|
} else {
|
this.applicationDetailArr.splice(rowIndex + 1, 0, rowData);
|
}
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
this.applicationDetailArr[i].orderno = i + 1;
|
}
|
},
|
|
deleteRow(index, rows, row) {
|
this.$confirm("是否确认删除?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "success",
|
})
|
.then(() => {
|
console.log(row);
|
if (row.id !== null) {
|
delReimbursementdetail(row.id).then((res) => {
|
this.$modal.msgSuccess("删除成功");
|
rows.splice(index, 1);
|
this.recountOrderNo();
|
this.sumTotalFee();
|
});
|
} else {
|
rows.splice(index, 1);
|
this.sumTotalFee();
|
this.$modal.msgSuccess("删除成功");
|
this.recountOrderNo();
|
}
|
})
|
.catch(() => {
|
//几点取消的提示
|
});
|
},
|
|
recountOrderNo() {
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
this.applicationDetailArr[i].orderno = i + 1;
|
}
|
},
|
|
//上报
|
handleup(row) {
|
console.log("rowrowrowrow", row);
|
|
this.$confirm("是否确认将登记记录上报?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
//调用差旅费上报接口
|
let tempParam = {
|
fundid: row.id,
|
};
|
fundSubmit(tempParam).then((response) => {
|
if (response.code == 200) {
|
this.getList();
|
this.$message({
|
type: "success",
|
message: "上报成功",
|
});
|
} else {
|
this.$message({
|
type: "error",
|
message: "上报失败",
|
});
|
}
|
this.loading = false;
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消申请",
|
});
|
});
|
},
|
|
//计算费用合计
|
sumTotalFee() {
|
// debugger;
|
let allSum = 0;
|
//捐献者家属费用
|
if (!isNaN(parseFloat(this.form.donoramount))) {
|
allSum += parseFloat(this.form.donoramount);
|
}
|
|
//报销明细费用
|
try {
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
let totalFee = 0;
|
//计算当前报销内容费用合计
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].trafficexpense))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].trafficexpense);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].cityfee))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].cityfee);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].hotelexpense))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].hotelexpense);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].otherexpense))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].otherexpense);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].foodexpenses))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].foodexpenses);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].foodallowance))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].foodallowance);
|
}
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].otherfeeamount))) {
|
totalFee += parseFloat(this.applicationDetailArr[i].otherfeeamount);
|
}
|
this.applicationDetailArr[i].total = parseFloat(totalFee).toFixed(2);
|
this.$set(this.applicationDetailArr, i, this.applicationDetailArr[i]);
|
if (!isNaN(parseFloat(this.applicationDetailArr[i].total))) {
|
allSum += parseFloat(this.applicationDetailArr[i].total);
|
}
|
}
|
|
this.form.amountrequested = allSum.toFixed(2);
|
this.form.bigstrmoney = this.convertCurrency(this.form.amountrequested);
|
} catch { }
|
},
|
|
getDetailArr(rbid) {
|
getReimbursementdetaillist(rbid).then((res) => {
|
this.applicationDetailArr = res.data;
|
for (let i = 0; i < this.applicationDetailArr.length; i++) {
|
this.applicationDetailArr[i].index = i;
|
this.applicationDetailArr[i].searchAddress = {
|
sheng: this.applicationDetailArr[i].travelprovincename,
|
shi: this.applicationDetailArr[i].travelcityname,
|
qu: this.applicationDetailArr[i].traveltownname,
|
};
|
}
|
this.sumTotalFee();
|
});
|
},
|
|
//金额大写
|
convertCurrency(money) {
|
//汉字的数字
|
var cnNums = new Array(
|
"零",
|
"壹",
|
"贰",
|
"叁",
|
"肆",
|
"伍",
|
"陆",
|
"柒",
|
"捌",
|
"玖"
|
);
|
//基本单位
|
var cnIntRadice = new Array("", "拾", "佰", "仟");
|
//对应整数部分扩展单位
|
var cnIntUnits = new Array("", "万", "亿", "兆");
|
//对应小数部分单位
|
var cnDecUnits = new Array("角", "分", "毫", "厘");
|
//整数金额时后面跟的字符
|
var cnInteger = "整";
|
//整型完以后的单位
|
var cnIntLast = "元";
|
//最大处理的数字
|
var maxNum = 999999999999999.9999;
|
//金额整数部分
|
var integerNum;
|
//金额小数部分
|
var decimalNum;
|
//输出的中文金额字符串
|
var chineseStr = "";
|
//分离金额后用的数组,预定义
|
var parts;
|
if (money == "") {
|
return "";
|
}
|
money = parseFloat(money);
|
if (money >= maxNum) {
|
//超出最大处理数字
|
return "";
|
}
|
if (money == 0) {
|
chineseStr = cnNums[0] + cnIntLast + cnInteger;
|
return chineseStr;
|
}
|
//转换为字符串
|
money = money.toString();
|
if (money.indexOf(".") == -1) {
|
integerNum = money;
|
decimalNum = "";
|
} else {
|
parts = money.split(".");
|
integerNum = parts[0];
|
decimalNum = parts[1].substr(0, 4);
|
}
|
//获取整型部分转换
|
if (parseInt(integerNum, 10) > 0) {
|
var zeroCount = 0;
|
var IntLen = integerNum.length;
|
for (var i = 0; i < IntLen; i++) {
|
var n = integerNum.substr(i, 1);
|
var p = IntLen - i - 1;
|
var q = p / 4;
|
var m = p % 4;
|
if (n == "0") {
|
zeroCount++;
|
} else {
|
if (zeroCount > 0) {
|
chineseStr += cnNums[0];
|
}
|
//归零
|
zeroCount = 0;
|
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
|
}
|
if (m == 0 && zeroCount < 4) {
|
chineseStr += cnIntUnits[q];
|
}
|
}
|
chineseStr += cnIntLast;
|
}
|
//小数部分
|
if (decimalNum != "") {
|
var decLen = decimalNum.length;
|
for (var i = 0; i < decLen; i++) {
|
var n = decimalNum.substr(i, 1);
|
if (n != "0") {
|
chineseStr += cnNums[Number(n)] + cnDecUnits[i];
|
}
|
}
|
}
|
if (chineseStr == "") {
|
chineseStr += cnNums[0] + cnIntLast + cnInteger;
|
} else if (decimalNum == "") {
|
chineseStr += cnInteger;
|
}
|
return chineseStr;
|
},
|
},
|
};
|
</script>
|