|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div class="table_btnbox">
|
|
|
<!-- 搜索 -->
|
|
|
<el-row class="top">
|
|
|
<el-form
|
|
|
@@ -87,21 +87,19 @@
|
|
|
<div class="dialog-body">
|
|
|
<el-form
|
|
|
:model="tableForm"
|
|
|
+ :rules="tableFormRules"
|
|
|
ref="tableForm"
|
|
|
- label-width="0px"
|
|
|
- class="demo-tableForm"
|
|
|
+ label-width="130px"
|
|
|
+ size="small"
|
|
|
+ class="tableForm"
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- label="单位:"
|
|
|
- label-width="50px"
|
|
|
- prop="company"
|
|
|
- >
|
|
|
+ <el-form-item label="支出单位:" prop="company">
|
|
|
<el-select
|
|
|
v-model="tableForm.company"
|
|
|
filterable
|
|
|
- placeholder="单位"
|
|
|
+ placeholder="支出单位"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in innerCollectionData"
|
|
|
@@ -113,42 +111,28 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col style="display: flex; justify-content: end" :span="12">
|
|
|
- <!-- <el-button type="primary" @click="addUserFn" size="small"
|
|
|
- >新增账户信息</el-button
|
|
|
- > -->
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <table
|
|
|
- class="expense-table"
|
|
|
- width="100%"
|
|
|
- height="500"
|
|
|
- border="1"
|
|
|
- bordercolor="#71787f"
|
|
|
- align="center"
|
|
|
- cellspacing=""
|
|
|
- cellpadding="10"
|
|
|
- style="border-collapse: collapse"
|
|
|
- >
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">申请人</td>
|
|
|
- <td class="td-content" colspan="1">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请人" prop="applicant">
|
|
|
<el-input
|
|
|
type="text"
|
|
|
resize="none"
|
|
|
v-model="tableForm.applicant"
|
|
|
></el-input>
|
|
|
- </td>
|
|
|
- <td class="td-title" colspan="1">申请部门</td>
|
|
|
- <td class="td-content" colspan="1">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请部门" prop="applySector">
|
|
|
<el-input
|
|
|
type="text"
|
|
|
resize="none"
|
|
|
v-model="tableForm.applySector"
|
|
|
></el-input>
|
|
|
- </td>
|
|
|
- <td class="td-title" colspan="1">申请日期</td>
|
|
|
- <td class="td-content" colspan="1">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请日期" prop="applyTime">
|
|
|
<el-date-picker
|
|
|
v-model="tableForm.applyTime"
|
|
|
align="right"
|
|
|
@@ -157,11 +141,16 @@
|
|
|
:picker-options="pickerOptions"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">收款单位信息</td>
|
|
|
- <td class="td-content" colspan="5">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="collec">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="收款单位信息"
|
|
|
+ style="width: 100%"
|
|
|
+ prop="collectionMessage"
|
|
|
+ >
|
|
|
<el-select
|
|
|
v-model="tableForm.collectionMessage"
|
|
|
filterable
|
|
|
@@ -175,47 +164,10 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">资金流程</td>
|
|
|
- <td class="td-content" colspan="5">
|
|
|
- <div style="display: flex; align-items: center">
|
|
|
- <el-select
|
|
|
- v-model="tableForm.company"
|
|
|
- filterable
|
|
|
- disabled
|
|
|
- placeholder=""
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in collectionData"
|
|
|
- :key="item.accountId + 'ac' + index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.bankCardNum"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <i class="el-icon-right"></i>
|
|
|
- <el-select
|
|
|
- v-model="tableForm.collectionMessage"
|
|
|
- filterable
|
|
|
- disabled
|
|
|
- placeholder=""
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in collectionData"
|
|
|
- :key="item.accountId + 'avb' + index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.bankCardNum"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">资金用途</td>
|
|
|
- <td class="td-content" colspan="3">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="资金用途" prop="fundUse">
|
|
|
<el-cascader
|
|
|
v-model="tableForm.fundUse"
|
|
|
:show-all-levels="false"
|
|
|
@@ -229,26 +181,50 @@
|
|
|
children: 'child',
|
|
|
label: 'category',
|
|
|
value: 'category',
|
|
|
- checkStrictly: true,
|
|
|
+ checkStrictly: false,
|
|
|
}"
|
|
|
></el-cascader>
|
|
|
- </td>
|
|
|
- <td class="td-title" colspan="1">备注</td>
|
|
|
- <td class="td-content" colspan="1">
|
|
|
- <el-select v-model="tableForm.remark" placeholder="" allow-create filterable>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="资金流程" prop="payMethod" class="paymethod">
|
|
|
+ <el-select
|
|
|
+ v-model="tableForm.company"
|
|
|
+ filterable
|
|
|
+ placeholder=""
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in innerCollectionData"
|
|
|
+ :key="item.accountId + '' + index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.bankCardNum"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <i class="el-icon-right"></i>
|
|
|
+ <el-select
|
|
|
+ v-model="tableForm.collectionMessage"
|
|
|
+ filterable
|
|
|
+ placeholder=""
|
|
|
+ disabled
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="item in use_fundsData"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.label"
|
|
|
+ v-for="(item, index) in collectionData"
|
|
|
+ :key="item.accountId + 'aa' + index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.bankCardNum"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">申请金额(元)</td>
|
|
|
- <td class="td-content" colspan="2">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请金额(元)" prop="applyAmount">
|
|
|
<el-input-number
|
|
|
v-model="tableForm.applyAmount"
|
|
|
:min="0"
|
|
|
@@ -257,20 +233,22 @@
|
|
|
:max="99999999999999999"
|
|
|
label=""
|
|
|
></el-input-number>
|
|
|
- </td>
|
|
|
- <td class="td-title" colspan="1">大写金额</td>
|
|
|
- <td class="td-content idea-box" colspan="2">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="大写金额" prop="bigApplyAmount">
|
|
|
<el-input
|
|
|
type="text"
|
|
|
resize="none"
|
|
|
v-model="tableForm.bigApplyAmount"
|
|
|
disabled
|
|
|
></el-input>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" colspan="1">支付方式</td>
|
|
|
- <td class="td-content" colspan="5">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="支付方式" prop="payMethod">
|
|
|
<el-checkbox-group v-model="tableForm.payMethod">
|
|
|
<el-checkbox
|
|
|
v-for="payItem in payment_methodsData"
|
|
|
@@ -280,41 +258,72 @@
|
|
|
:disabled="payItem.value == 2"
|
|
|
></el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td class="td-title" rowspan="2" colspan="1">审核意见</td>
|
|
|
- <td class="td-title" colspan="2">公司领导</td>
|
|
|
- <td class="td-title" colspan="1">财务部</td>
|
|
|
- <td class="td-title" colspan="2">部门领导</td>
|
|
|
- </tr>
|
|
|
- <tr class="idea-box">
|
|
|
- <td class="td-content" colspan="2">
|
|
|
- <el-input
|
|
|
- type="text"
|
|
|
- resize="none"
|
|
|
- v-model="tableForm.desc"
|
|
|
- disabled
|
|
|
- ></el-input>
|
|
|
- </td>
|
|
|
- <td class="td-content" colspan="1">
|
|
|
- <el-input
|
|
|
- type="text"
|
|
|
- resize="none"
|
|
|
- v-model="tableForm.desc"
|
|
|
- disabled
|
|
|
- ></el-input>
|
|
|
- </td>
|
|
|
- <td class="td-content" colspan="2">
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
<el-input
|
|
|
type="text"
|
|
|
resize="none"
|
|
|
- v-model="tableForm.desc"
|
|
|
- disabled
|
|
|
+ v-model="tableForm.remark"
|
|
|
></el-input>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="收入方资金归属" prop="entProfit">
|
|
|
+ <el-select
|
|
|
+ v-model="profitObj.entProfitName"
|
|
|
+ filterable
|
|
|
+ @change="profitChange($event, 1)"
|
|
|
+ placeholder=""
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in affiliationData"
|
|
|
+ :key="item.profitId + 'ent' + index"
|
|
|
+ :label="item.profitName"
|
|
|
+ :value="item.profitEng"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input-number
|
|
|
+ v-model="profitObj.entProfitValue"
|
|
|
+ :min="0"
|
|
|
+ @blur="profitBlur($event, 1)"
|
|
|
+ placeholder="请输入利润(%)"
|
|
|
+ :max="100"
|
|
|
+ label=""
|
|
|
+ ></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="支出方资金归属" prop="outFlag">
|
|
|
+ <el-select
|
|
|
+ v-model="profitObj.outProfitName"
|
|
|
+ filterable
|
|
|
+ @change="profitChange($event, 2)"
|
|
|
+ placeholder=""
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in affiliationData"
|
|
|
+ :key="item.profitId + 'out' + index"
|
|
|
+ :label="item.profitName"
|
|
|
+ :value="item.profitEng"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input-number
|
|
|
+ v-model="profitObj.outProfitValue"
|
|
|
+ :min="0"
|
|
|
+ @blur="profitBlur($event, 2)"
|
|
|
+ placeholder="请输入利润(%)"
|
|
|
+ :max="100"
|
|
|
+ label=""
|
|
|
+ ></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -339,7 +348,7 @@
|
|
|
:visible.sync="expenseaaa"
|
|
|
width="60%"
|
|
|
> -->
|
|
|
- <!-- <ExpenseManagement></ExpenseManagement> -->
|
|
|
+ <!-- <ExpenseManagement></ExpenseManagement> -->
|
|
|
<!-- </el-dialog> -->
|
|
|
<!-- 新增账户弹框 -->
|
|
|
<!-- <expense-component
|
|
|
@@ -362,10 +371,18 @@ import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
import { toChies } from "../../../utils/moneyTransition";
|
|
|
export default {
|
|
|
name: "ExpenseApplyFor",
|
|
|
- components: { KtCommonTable, ExpenseComponent,},
|
|
|
+ components: { KtCommonTable, ExpenseComponent },
|
|
|
data() {
|
|
|
+ //开票金额自定义校验
|
|
|
+ let applyAmountRules = (rule, value, callback) => {
|
|
|
+ if (value == 0) {
|
|
|
+ callback(new Error("申请金额不能小于0"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
- expenseaaa:true,
|
|
|
+ expenseaaa: true,
|
|
|
expendTitle: "新增资金使用申请单", //弹框标题
|
|
|
operationWidth: 200, //操作单元格宽度
|
|
|
queryFrom: {}, //查询form表单
|
|
|
@@ -377,11 +394,12 @@ export default {
|
|
|
dialogFormVisible: false, //账户信息弹出框状态
|
|
|
title: "新增账户信息", //账户信息弹框标题
|
|
|
expenseDialog: false, //申请单显示状态
|
|
|
- pageResult: {//表格参数
|
|
|
+ pageResult: {
|
|
|
+ //表格参数
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
content: [],
|
|
|
- },
|
|
|
+ },
|
|
|
formData: {
|
|
|
outerFlag: "0", //账户类别
|
|
|
accountName: "", //户名
|
|
|
@@ -477,7 +495,6 @@ export default {
|
|
|
minWidth: 100,
|
|
|
sortable: false,
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
prop: "payMethod",
|
|
|
label: "支付方式",
|
|
|
@@ -516,36 +533,36 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
payment_methodsData: [], //支付方式字典数据
|
|
|
- use_fundsData: [], //备注字典数据
|
|
|
+ affiliationData: [], //归属字典数据
|
|
|
collectionData: [], //收款单位信息数据
|
|
|
innerCollectionData: [], //内部账户单位信息数据
|
|
|
account_qualityData: [], //账户性质字典
|
|
|
fundFlowData: [], //资金用途字典数据
|
|
|
- tableRules: {
|
|
|
+ tableFormRules: {
|
|
|
//资金申请单规则
|
|
|
- name: [
|
|
|
- { required: true, message: "请输入活动名称", trigger: "blur" },
|
|
|
- { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
|
|
|
- ],
|
|
|
- region: [
|
|
|
- { required: true, message: "请选择活动区域", trigger: "change" },
|
|
|
- ],
|
|
|
- date1: [
|
|
|
+ company: [
|
|
|
{
|
|
|
- type: "date",
|
|
|
required: true,
|
|
|
- message: "请选择日期",
|
|
|
+ message: "请至少选择一个支出单位",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- date2: [
|
|
|
+ applicant: [
|
|
|
+ { required: true, message: "申请人不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ applySector: [
|
|
|
+ { required: true, message: "申请部门不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ applyTime: [
|
|
|
{
|
|
|
- type: "date",
|
|
|
+ type: "string",
|
|
|
required: true,
|
|
|
- message: "请选择时间",
|
|
|
+ message: "请选择申请日期",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
+ applyAmount: [{ validator: applyAmountRules, trigger: "blur" }],
|
|
|
+ remark: [{ required: true, message: "备注不能为空", trigger: "blur" }],
|
|
|
type: [
|
|
|
{
|
|
|
type: "array",
|
|
|
@@ -554,10 +571,12 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- resource: [
|
|
|
- { required: true, message: "请选择活动资源", trigger: "change" },
|
|
|
+ collectionMessage: [
|
|
|
+ { required: true, message: "请选择收款单位信息", trigger: "change" },
|
|
|
+ ],
|
|
|
+ fundUse: [
|
|
|
+ { required: true, message: "请选择资金用途", trigger: "change" },
|
|
|
],
|
|
|
- desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }],
|
|
|
},
|
|
|
companyItem: {}, //选择单位整条数据
|
|
|
collectionMessageItem: {}, //选择收款单位整条数据
|
|
|
@@ -577,6 +596,12 @@ export default {
|
|
|
bigApplyAmount: "", //大写金额
|
|
|
payMethod: [], //支付方式
|
|
|
},
|
|
|
+ profitObj: {
|
|
|
+ outProfitValue: "", //支出资金归属
|
|
|
+ outProfitName: "", //支出利润
|
|
|
+ entProfitValue: "", //收入资金归属
|
|
|
+ entProfitName: "", //收入利润
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -595,6 +620,12 @@ export default {
|
|
|
bigApplyAmount: "", //大写金额
|
|
|
payMethod: [], //支付方式
|
|
|
};
|
|
|
+ this.profitObj = {
|
|
|
+ outProfitValue: "", //支出资金归属
|
|
|
+ outProfitName: "", //支出利润
|
|
|
+ entProfitValue: "", //收入资金归属
|
|
|
+ entProfitName: "", //收入利润
|
|
|
+ };
|
|
|
this.tableForm.payMethod = [
|
|
|
this.payment_methodsData.find((item) => item.value == 2).label,
|
|
|
];
|
|
|
@@ -608,12 +639,57 @@ export default {
|
|
|
this.business("account_quality"); //账户性质字典
|
|
|
this.getTreeList(); //获取资金用途树字典
|
|
|
this.getAllUser(); //获取所有银行账户信息
|
|
|
+ this.getAffiliationData(); //获取归属数据
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
+ //收入资金归属change事件
|
|
|
+ profitChange(e, num) {
|
|
|
+ if (num == 1) {
|
|
|
+ //收入
|
|
|
+ this.profitObj.entProfitName = e;
|
|
|
+ this.tableForm.entProfit = {
|
|
|
+ [this.profitObj.entProfitName]: this.profitObj.entProfitValue,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ //支出
|
|
|
+ this.profitObj.outProfitName = e;
|
|
|
+ this.tableForm.outProfit = {
|
|
|
+ [this.profitObj.outProfitName]: this.profitObj.outProfitValue,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //收入资金归属利润事件
|
|
|
+ profitBlur(e, num) {
|
|
|
+ this.tableForm.entProfit = {
|
|
|
+ [this.profitObj.entProfitName]: this.profitObj.entProfitValue,
|
|
|
+ };
|
|
|
+ this.tableForm.outProfit = {
|
|
|
+ [this.profitObj.outProfitName]: this.profitObj.outProfitValue,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //获取归属数据
|
|
|
+ getAffiliationData() {
|
|
|
+ this.$api.expense.getList().then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.affiliationData = res.data;
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ this.columns.push({
|
|
|
+ prop: item.profitEng,
|
|
|
+ label: item.profitName,
|
|
|
+ minWidth: 60,
|
|
|
+ sortable: false,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//导出
|
|
|
expendDataup(idList) {
|
|
|
- if (this.expendDataId) { //编辑查看直接导出
|
|
|
+ if (this.expendDataId) {
|
|
|
+ //编辑查看直接导出
|
|
|
let url = process.env.BASE_URL + "/upload/" + this.tableForm.uplodePath; // 3.创建一个临时的url指向blob对象
|
|
|
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
|
|
|
let a = document.createElement("a");
|
|
|
@@ -624,7 +700,8 @@ export default {
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
this.resetForm();
|
|
|
this.findPage();
|
|
|
- } else { //新增并导出
|
|
|
+ } else {
|
|
|
+ //新增并导出
|
|
|
this.$api.expense.excel(idList).then((response) => {
|
|
|
if (response.code == 200) {
|
|
|
response.data.forEach((data) => {
|
|
|
@@ -661,16 +738,18 @@ export default {
|
|
|
this.tableForm.payMethod = this.tableForm.payMethod.split(",");
|
|
|
this.tableForm.collectionMessage = res.data.enterCardNum;
|
|
|
this.tableForm.company = res.data.outCardNum;
|
|
|
- let obj = this.fundFlowData.find((item) =>
|
|
|
- item.child.find(
|
|
|
- (chidlItem) => chidlItem.category == this.tableForm.fundUse
|
|
|
- )
|
|
|
- );
|
|
|
this.tableForm.fundUse = [
|
|
|
- obj.category,
|
|
|
- obj.child.find((item) => item.category == this.tableForm.fundUse)
|
|
|
- .category,
|
|
|
+ this.tableForm.fundUse,
|
|
|
+ this.tableForm.fundFen,
|
|
|
];
|
|
|
+ for (let key in res.data.outProfit) {
|
|
|
+ this.profitObj.outProfitName = key;
|
|
|
+ this.profitObj.outProfitValue = res.data.outProfit[key];
|
|
|
+ }
|
|
|
+ for (let key in res.data.entProfit) {
|
|
|
+ this.profitObj.entProfitName = key;
|
|
|
+ this.profitObj.entProfitValue = res.data.entProfit[key];
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
|
@@ -706,9 +785,25 @@ export default {
|
|
|
//获取资金用途树数据
|
|
|
getTreeList() {
|
|
|
this.$api.expense.getAccountExpensesTreeList().then((res) => {
|
|
|
- this.fundFlowData = res.data;
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.fundFlowData = res.data;
|
|
|
+ this.fundFlowSet();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
+ //资金用途数据转换 如果最后一项child数组长度为0把值变为null
|
|
|
+ fundFlowSet(data) {
|
|
|
+ data = data || this.fundFlowData;
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].child.length) {
|
|
|
+ this.fundFlowSet(data[i].child);
|
|
|
+ } else {
|
|
|
+ data[i].child = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//搜索列表功能
|
|
|
queryStaffInfo() {
|
|
|
this.findPage();
|
|
|
@@ -724,6 +819,12 @@ export default {
|
|
|
.getAccountExcel(obj)
|
|
|
.then((res) => {
|
|
|
res.data.records.forEach((element) => {
|
|
|
+ for (let key in element.outProfit) {
|
|
|
+ element[key] = element.outProfit[key];
|
|
|
+ }
|
|
|
+ for (let key in element.entProfit) {
|
|
|
+ element[key] = element.entProfit[key];
|
|
|
+ }
|
|
|
element.transferFlagName =
|
|
|
element.transferFlag == 0 ? "已转账" : "未转账";
|
|
|
});
|
|
|
@@ -846,7 +947,7 @@ export default {
|
|
|
this.$api.expense.getAccountByAccountName().then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
let arr = [];
|
|
|
- let newarr = []
|
|
|
+ let newarr = [];
|
|
|
res.data.forEach((item, index) => {
|
|
|
if (item.invAccountCardList != null) {
|
|
|
item.invAccountCardList.forEach((it) => {
|
|
|
@@ -865,8 +966,8 @@ export default {
|
|
|
});
|
|
|
arr.push(...item.invAccountCardList);
|
|
|
//获取全部内部用户
|
|
|
- if(item.outerFlag == 0){
|
|
|
- newarr.push(...item.invAccountCardList)
|
|
|
+ if (item.outerFlag == 0) {
|
|
|
+ newarr.push(...item.invAccountCardList);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -903,64 +1004,77 @@ export default {
|
|
|
//导出事件
|
|
|
submitForm() {
|
|
|
let params = JSON.parse(JSON.stringify(this.tableForm));
|
|
|
- //校验
|
|
|
- if (!params.company) {
|
|
|
- this.$message.error("请选择单位");
|
|
|
- return;
|
|
|
- } else if (!params.applicant) {
|
|
|
- this.$message.error("申请人不能为空");
|
|
|
- return;
|
|
|
- } else if (!params.applySector) {
|
|
|
- this.$message.error("申请部门不能为空");
|
|
|
- return;
|
|
|
- } else if (!params.applyTime) {
|
|
|
- this.$message.error("请填写申请日期");
|
|
|
- return;
|
|
|
- } else if (!params.collectionMessage) {
|
|
|
- this.$message.error("请选择收款单位信息");
|
|
|
- return;
|
|
|
- } else if (!params.fundUse) {
|
|
|
- this.$message.error("请选择资金用途");
|
|
|
- return;
|
|
|
- } else if (params.applyAmount == 0) {
|
|
|
- this.$message.error("请填写金额");
|
|
|
- return;
|
|
|
+ if( !this.profitObj.entProfitName||!this.profitObj.outProfitName){
|
|
|
+ this.$message.error('请选择资金归属!');
|
|
|
+ return
|
|
|
}
|
|
|
- params.payMethod = this.toPayment(params.payMethod); //支付方式转换
|
|
|
- let companyItem = this.collectionData.find((item) => {
|
|
|
- return item.bankCardNum === params.company;
|
|
|
- });
|
|
|
- let collectionMessageItem = this.collectionData.find(
|
|
|
- (item) => item.bankCardNum === params.collectionMessage
|
|
|
- );
|
|
|
- params.company = companyItem.nameValue; //单位
|
|
|
- params.outCardNum = companyItem.bankCardNum; //支出账户id
|
|
|
- params.outFlag = collectionMessageItem.outerFlag; //支出账户性质
|
|
|
- params.collectionMessage = collectionMessageItem.nameValue; //收入账户信息
|
|
|
- params.enterCardNum = collectionMessageItem.bankCardNum; //收入账户id
|
|
|
- params.fundUse = params.fundUse[params.fundUse.length - 1]; //资金用途
|
|
|
- params.fundFlow = params.company + "→" + params.collectionMessage; //资金流程
|
|
|
- if (this.expendDataId) {
|
|
|
- //修改
|
|
|
- params.expendDataId = this.expendDataId;
|
|
|
- this.$api.expense.update(params).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.resetForm();
|
|
|
- this.findPage();
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- //新增+导出
|
|
|
- this.$api.expense.insert(params).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.expendDataup([res.data]);
|
|
|
+ this.$refs.tableForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ params.payMethod = this.toPayment(params.payMethod); //支付方式转换
|
|
|
+ let companyItem = this.collectionData.find((item) => {
|
|
|
+ return item.bankCardNum === params.company;
|
|
|
+ });
|
|
|
+ let collectionMessageItem = this.collectionData.find(
|
|
|
+ (item) => item.bankCardNum === params.collectionMessage
|
|
|
+ );
|
|
|
+ params.company = companyItem.nameValue; //单位
|
|
|
+ params.outCardNum = companyItem.bankCardNum; //支出账户id
|
|
|
+ params.outFlag = collectionMessageItem.outerFlag; //支出账户性质
|
|
|
+ params.collectionMessage = collectionMessageItem.nameValue; //收入账户信息
|
|
|
+ params.enterCardNum = collectionMessageItem.bankCardNum; //收入账户id
|
|
|
+ params.fundUse =
|
|
|
+ this.tableForm.fundUse[this.tableForm.fundUse.length - 2]; //资金用途
|
|
|
+ params.fundFen =
|
|
|
+ this.tableForm.fundUse[this.tableForm.fundUse.length - 1]; //资金用途分项
|
|
|
+ params.fundFlow = params.company + "→" + params.collectionMessage; //资金流程
|
|
|
+ if (this.expendDataId) {
|
|
|
+ //修改
|
|
|
+ params.expendDataId = this.expendDataId;
|
|
|
+ this.$api.expense.update(params).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.resetForm();
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.$message.error(res.msg);
|
|
|
+ //新增+导出
|
|
|
+ this.$api.expense.insert(params).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.expendDataup([res.data]);
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //校验
|
|
|
+ // if (!params.company) {
|
|
|
+ // this.$message.error("请选择单位");
|
|
|
+ // return;
|
|
|
+ // } else if (!params.applicant) {
|
|
|
+ // this.$message.error("申请人不能为空");
|
|
|
+ // return;
|
|
|
+ // } else if (!params.applySector) {
|
|
|
+ // this.$message.error("申请部门不能为空");
|
|
|
+ // return;
|
|
|
+ // } else if (!params.applyTime) {
|
|
|
+ // this.$message.error("请填写申请日期");
|
|
|
+ // return;
|
|
|
+ // } else if (!params.collectionMessage) {
|
|
|
+ // this.$message.error("请选择收款单位信息");
|
|
|
+ // return;
|
|
|
+ // } else if (!params.fundUse) {
|
|
|
+ // this.$message.error("请选择资金用途");
|
|
|
+ // return;
|
|
|
+ // } else if (params.applyAmount == 0) {
|
|
|
+ // this.$message.error("请填写金额");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
},
|
|
|
//支付方式转换
|
|
|
toPayment(list) {
|
|
|
@@ -1006,14 +1120,13 @@ export default {
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
}
|
|
|
-.expense-table >>> .el-checkbox-group,
|
|
|
-.expense-table >>> .el-date-editor,
|
|
|
-.expense-table >>> .el-select,
|
|
|
-.expense-table >>> .el-input-number,
|
|
|
-.expense-table >>> .el-cascader,
|
|
|
-.demo-tableForm >>> .el-select {
|
|
|
+.tableForm >>> .el-checkbox-group,
|
|
|
+.tableForm >>> .el-date-editor,
|
|
|
+.tableForm >>> .el-select,
|
|
|
+.tableForm >>> .el-input-number,
|
|
|
+.tableForm >>> .el-cascader,
|
|
|
+.tableForm >>> .el-select {
|
|
|
width: 100%;
|
|
|
- text-align: center;
|
|
|
}
|
|
|
.demo-tableForm >>> .el-input__inner {
|
|
|
border: none;
|
|
|
@@ -1054,4 +1167,14 @@ export default {
|
|
|
.operation {
|
|
|
margin-bottom: 15px;
|
|
|
}
|
|
|
+.paymethod >>> .el-form-item__content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.el-icon-right {
|
|
|
+ margin: 0 10px;
|
|
|
+}
|
|
|
+.table_btnbox {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
</style>
|