|
@@ -1,63 +1,68 @@
|
|
|
<template>
|
|
|
<HcCard>
|
|
|
<template #header>
|
|
|
- <div class="hc-expense-total-title">报销总额(元):{{totalFrMoney}}</div>
|
|
|
+ <div class="hc-expense-total-title">
|
|
|
+ 报销总额(元):{{ totalFrMoney }}
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<div class="hac-expense-record-body">
|
|
|
<div class="record-form-box">
|
|
|
<el-scrollbar>
|
|
|
- <HcCardItem :title="'报销明细' + (index + 1)" v-for="(item, index) in detailsData.details" ui="hac-bg-grey mb-5">
|
|
|
+ <HcCardItem v-for="(item, index) in detailsData.details" :title="`报销明细${index + 1}`" ui="hac-bg-grey mb-5">
|
|
|
<template #extra>
|
|
|
- <el-button type="danger" size="small" @click="delDetailsData(index)" v-if="index > 0">
|
|
|
- <HcIcon name="delete-bin"/>
|
|
|
+ <el-button v-if="index > 0" type="danger" size="small" @click="delDetailsData(index)">
|
|
|
+ <HcIcon name="delete-bin" />
|
|
|
<span>删除明细</span>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<el-form :ref="(el) => setFormItemRefs(el, index)" :model="item" :rules="formRules" label-position="left" label-width="auto" size="large">
|
|
|
<div class="hc-form-item">
|
|
|
<el-form-item label="所属项目:" prop="projectId">
|
|
|
- <el-select block v-model="item.projectId">
|
|
|
- <el-option v-for="items in projectData" :label="items.projectName" :value="items.projectId"/>
|
|
|
+ <el-select v-model="item.projectId" block>
|
|
|
+ <el-option v-for="items in projectData" :label="items.projectName" :value="items.projectId" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<div class="ml-2">
|
|
|
- <el-button type="default" @click="budgetModalShow(item,index)" >
|
|
|
- <HcIcon name="add"/>
|
|
|
+ <el-button type="default" @click="budgetModalShow(item, index)">
|
|
|
+ <HcIcon name="add" />
|
|
|
<span>关联预算计划</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="hc-form-item">
|
|
|
<el-form-item label="报销金额(元):" prop="frMoney">
|
|
|
- <el-input-number v-model="item.frMoney" :precision="2" style="width: 100%;" :min="0"></el-input-number>
|
|
|
+ <el-input-number v-model="item.frMoney" :precision="2" style="width: 100%;" :min="0" />
|
|
|
<!-- <el-input v-model="item.frMoney" placeholder="请输入报销金额" /> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="费用发生日期:" prop="frDate">
|
|
|
- <el-date-picker type="date" class="block" v-model="item.frDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
|
|
|
+ <el-date-picker v-model="item.frDate" type="date" class="block" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="费用类型:" prop="frType">
|
|
|
- <el-select block v-model="item.frType">
|
|
|
- <el-option v-for="items in frTypeData" :label="items.dictName" :value="items.dictValue"/>
|
|
|
+ <el-select v-model="item.frType" block>
|
|
|
+ <el-option v-for="items in frTypeData" :label="items.dictName" :value="items.dictValue" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item label="费用说明:">
|
|
|
- <el-input type="textarea"
|
|
|
- v-model="item.frDesc"
|
|
|
- :autosize="{ minRows: 3, maxRows: 5 }"
|
|
|
- placeholder="请输入费用说明"
|
|
|
+ <el-input
|
|
|
+ v-model="item.frDesc"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 3, maxRows: 5 }"
|
|
|
+ placeholder="请输入费用说明"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="电子发票:">
|
|
|
- <HcFormUpload :src="item.frElectronicInvoiceUrl"
|
|
|
- @upload="invoiceItemUpload(index)"
|
|
|
- @change="invoiceItemChange($event, index)"
|
|
|
+ <HcFormUpload
|
|
|
+ :src="item.frElectronicInvoiceUrl"
|
|
|
+ @upload="invoiceItemUpload(index)"
|
|
|
+ @change="invoiceItemChange($event, index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="附件文件:">
|
|
|
- <HcFormUpload :src="item.frAttachmentUrl"
|
|
|
- @upload="fileItemUpload(index)"
|
|
|
- @change="fileItemChange($event, index)"
|
|
|
+ <HcFormUpload
|
|
|
+ :src="item.frAttachmentUrl"
|
|
|
+ @upload="fileItemUpload(index)"
|
|
|
+ @change="fileItemChange($event, index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -65,14 +70,14 @@
|
|
|
<div class="record-form-action-box mt-11">
|
|
|
<el-divider content-position="right" border-style="dashed">
|
|
|
<el-button type="primary" hc-btn @click="addDetailsData">
|
|
|
- <HcIcon name="add"/>
|
|
|
+ <HcIcon name="add" />
|
|
|
<span>添加明细</span>
|
|
|
</el-button>
|
|
|
</el-divider>
|
|
|
<el-form class="mt-16" inline :model="detailsData" label-position="top">
|
|
|
<el-form-item label="归属人">
|
|
|
<el-select v-model="detailsData.userIdVesting" clearable>
|
|
|
- <el-option v-for="item in userList" :label="item.name" :value="item.id"/>
|
|
|
+ <el-option v-for="item in userList" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="是否抵消借款金额">
|
|
@@ -88,7 +93,9 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="冲抵后的实际报销金额">
|
|
|
<el-input v-model="detailsData.frMoneyActual" disabled>
|
|
|
- <template #append>元</template>
|
|
|
+ <template #append>
|
|
|
+ 元
|
|
|
+ </template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -96,72 +103,87 @@
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<div class="record-flow-box">
|
|
|
- <div class="title">流程</div>
|
|
|
+ <div class="title">
|
|
|
+ 流程
|
|
|
+ </div>
|
|
|
<div class="content">
|
|
|
<el-scrollbar>
|
|
|
- <el-timeline v-if="totalFrMoney<=1000">
|
|
|
+ <el-timeline v-if="totalFrMoney <= 1000">
|
|
|
<el-timeline-item v-for="(item, index) in timeLineData1" :key="index">
|
|
|
- <div class="timeline-title">{{item.title}}</div>
|
|
|
- <div class="timeline-section">{{item.section}}</div>
|
|
|
+ <div class="timeline-title">
|
|
|
+ {{ item.title }}
|
|
|
+ </div>
|
|
|
+ <div class="timeline-section">
|
|
|
+ {{ item.section }}
|
|
|
+ </div>
|
|
|
</el-timeline-item>
|
|
|
</el-timeline>
|
|
|
<el-timeline v-else>
|
|
|
<el-timeline-item v-for="(item, index) in timeLineData" :key="index">
|
|
|
- <div class="timeline-title">{{item.title}}</div>
|
|
|
- <div class="timeline-section">{{item.section}}</div>
|
|
|
+ <div class="timeline-title">
|
|
|
+ {{ item.title }}
|
|
|
+ </div>
|
|
|
+ <div class="timeline-section">
|
|
|
+ {{ item.section }}
|
|
|
+ </div>
|
|
|
</el-timeline-item>
|
|
|
</el-timeline>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<div class="action">
|
|
|
<el-button type="warning" :loading="tempLoading" hc-btn @click="tempDraftData">
|
|
|
- <HcIcon name="draft"/>
|
|
|
+ <HcIcon name="draft" />
|
|
|
<span>暂存草稿</span>
|
|
|
</el-button>
|
|
|
<el-button type="primary" :loading="submitLoading" hc-btn @click="submitFormData">
|
|
|
- <HcIcon name="check-double"/>
|
|
|
+ <HcIcon name="check-double" />
|
|
|
<span>提交报销申请</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!--上传控件-->
|
|
|
- <HcUploadFile ref="HcUploadFileRef"
|
|
|
- :options="uploadFileOptions"
|
|
|
- :echoParams="uploadEchoParams"
|
|
|
- @item="HcUploadFileItem"
|
|
|
- @success="HcUploadFileSuccess"
|
|
|
+ <!-- 上传控件 -->
|
|
|
+ <HcUploadFile
|
|
|
+ ref="HcUploadFileRef"
|
|
|
+ :options="uploadFileOptions"
|
|
|
+ :echo-params="uploadEchoParams"
|
|
|
+ @item="HcUploadFileItem"
|
|
|
+ @success="HcUploadFileSuccess"
|
|
|
/>
|
|
|
|
|
|
- <!--关联预算计划-->
|
|
|
- <HcDialog bgColor="#ffffff" isToBody isTable
|
|
|
- title="关联预算计划" widths="80%" saveText="保存"
|
|
|
- :show="budgetModal"
|
|
|
- @close="budgetCloseClick"
|
|
|
- @save="budgetSaveClick"
|
|
|
+ <!-- 关联预算计划 -->
|
|
|
+ <HcDialog
|
|
|
+ bg-color="#ffffff" is-to-body is-table
|
|
|
+ title="关联预算计划" widths="80%" save-text="保存"
|
|
|
+ :show="budgetModal"
|
|
|
+ @close="budgetCloseClick"
|
|
|
+ @save="budgetSaveClick"
|
|
|
>
|
|
|
<HcTable :column="tableBudgetColumn" :datas="tableBudgetData" :loading="tableBudgetLoading">
|
|
|
- <template #action="{row,index}">
|
|
|
- <el-button size="small" type="danger" @click="rowDisassociate(row)" v-if="row.isRelevance">取消关联</el-button>
|
|
|
- <el-button size="small" type="primary" @click="rowRelevance(row)" v-else>关联</el-button>
|
|
|
+ <template #action="{ row, index }">
|
|
|
+ <el-button v-if="row.isRelevance" size="small" type="danger" @click="rowDisassociate(row)">
|
|
|
+ 取消关联
|
|
|
+ </el-button>
|
|
|
+ <el-button v-else size="small" type="primary" @click="rowRelevance(row)">
|
|
|
+ 关联
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
</HcDialog>
|
|
|
-
|
|
|
</HcCard>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {onActivated, ref,watch} from "vue";
|
|
|
-import {useRoute, useRouter} from 'vue-router'
|
|
|
-import mainApi from "~api/expense/finReimburse";
|
|
|
-import {getTokenHeader} from "~src/api/request/header";
|
|
|
-import {arrIndex, deepClone, formValidate, getArrValue, getObjValue} from "js-fast-way";
|
|
|
-import {getProjectList, getDictInfo,getuserList,getApprovesList} from "~api/other";
|
|
|
-import {delMessage} from "~uti/tools";
|
|
|
-import {useAppStore} from "~src/store";
|
|
|
-const useAppState = useAppStore();
|
|
|
+import { onActivated, ref, watch } from 'vue'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+import mainApi from '~api/expense/finReimburse'
|
|
|
+import { getTokenHeader } from '~src/api/request/header'
|
|
|
+import { arrIndex, deepClone, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
+import { getApprovesList, getDictInfo, getProjectList, getuserList } from '~api/other'
|
|
|
+import { delMessage } from '~uti/tools'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+const useAppState = useAppStore()
|
|
|
|
|
|
//初始变量
|
|
|
const router = useRouter()
|
|
@@ -180,17 +202,17 @@ onActivated(() => {
|
|
|
const detailsData = ref({})//详情数据
|
|
|
//深度监听
|
|
|
watch(() => [
|
|
|
- detailsData.value.details
|
|
|
+ detailsData.value.details,
|
|
|
], ([datas]) => {
|
|
|
- let num=0
|
|
|
+ let num = 0
|
|
|
datas.forEach((ele)=>{
|
|
|
- if(Number(ele?.frMoney)){
|
|
|
- num=num+Number(ele?.frMoney)
|
|
|
+ if (Number(ele?.frMoney)) {
|
|
|
+ num = num + Number(ele?.frMoney)
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- totalFrMoney.value=num
|
|
|
-}, {deep: true})
|
|
|
+ totalFrMoney.value = num
|
|
|
+}, { deep: true })
|
|
|
//请求接口
|
|
|
const getApi = () => {
|
|
|
getProjectData()
|
|
@@ -202,22 +224,22 @@ const getApi = () => {
|
|
|
if (dataId.value > 0 && dataType.value !== 'add') {
|
|
|
getDetailsData()
|
|
|
} else {
|
|
|
- console.log('新增');
|
|
|
- console.log(detailsObj,'detailsObj');
|
|
|
+ console.log('新增')
|
|
|
+ console.log(detailsObj, 'detailsObj')
|
|
|
|
|
|
totalFrMoney.value = 0
|
|
|
detailsData.value = {
|
|
|
...detailsObj,
|
|
|
details: [{
|
|
|
- projectId: null, // 所属项目id
|
|
|
- budgetPlanIds: '', // 预算计划ids
|
|
|
- frMoney: null, // 报销金额
|
|
|
- frDate: null, // 报销时间
|
|
|
- frDesc: '', // 费用说明
|
|
|
- frType: null, // 报销类型
|
|
|
+ projectId: null, // 所属项目id
|
|
|
+ budgetPlanIds: '', // 预算计划ids
|
|
|
+ frMoney: null, // 报销金额
|
|
|
+ frDate: null, // 报销时间
|
|
|
+ frDesc: '', // 费用说明
|
|
|
+ frType: null, // 报销类型
|
|
|
frElectronicInvoiceUrl: '', // 电子发票url地址
|
|
|
- frAttachmentUrl: '', // 附件url地址
|
|
|
- }]
|
|
|
+ frAttachmentUrl: '', // 附件url地址
|
|
|
+ }],
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -225,7 +247,7 @@ const getApi = () => {
|
|
|
//获取项目数据
|
|
|
const projectData = ref([])
|
|
|
const getProjectData = async () => {
|
|
|
- const {error, code, data} = await getProjectList()
|
|
|
+ const { error, code, data } = await getProjectList()
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
projectData.value = getArrValue(data)
|
|
@@ -237,7 +259,7 @@ const getProjectData = async () => {
|
|
|
//费用类型字典
|
|
|
const frTypeData = ref([])
|
|
|
const expenseFrType = async () => {
|
|
|
- const {error, code, data} = await getDictInfo('expense_fr_type')
|
|
|
+ const { error, code, data } = await getDictInfo('expense_fr_type')
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
frTypeData.value = getArrValue(data)
|
|
@@ -249,7 +271,7 @@ const expenseFrType = async () => {
|
|
|
//获取我的借款列表
|
|
|
const loanListData = ref([])
|
|
|
const getLoanListData = async () => {
|
|
|
- const {error, code, data} = await mainApi.loanList()
|
|
|
+ const { error, code, data } = await mainApi.loanList()
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
loanListData.value = getArrValue(data)
|
|
@@ -258,9 +280,9 @@ const getLoanListData = async () => {
|
|
|
}
|
|
|
}
|
|
|
//获取所有员工
|
|
|
-const userList=ref([])
|
|
|
-const getUserDict=async()=>{
|
|
|
- const {error, code, data} = await getuserList({tenantId:useAppState.tenantId})
|
|
|
+const userList = ref([])
|
|
|
+const getUserDict = async ()=>{
|
|
|
+ const { error, code, data } = await getuserList({ tenantId:useAppState.tenantId })
|
|
|
if (!error && code === 200) {
|
|
|
userList.value = getArrValue(data)
|
|
|
|
|
@@ -272,24 +294,24 @@ const getUserDict=async()=>{
|
|
|
|
|
|
//基础详情
|
|
|
const detailsObj = {
|
|
|
- frMoney: 0, // 报销金额
|
|
|
- frMoneyActual: null, // 实际报销金额
|
|
|
- userIdVesting: null, // 归属人id
|
|
|
- isDeductLoan: 0, // 是否抵扣借款 0=否 1=是
|
|
|
- deductLoanId: null, // 借款信息id
|
|
|
- status: null, // 审批状态 0=未上报 1=待审批 2=已审批 3=已驳回
|
|
|
+ frMoney: 0, // 报销金额
|
|
|
+ frMoneyActual: null, // 实际报销金额
|
|
|
+ userIdVesting: null, // 归属人id
|
|
|
+ isDeductLoan: 0, // 是否抵扣借款 0=否 1=是
|
|
|
+ deductLoanId: null, // 借款信息id
|
|
|
+ status: null, // 审批状态 0=未上报 1=待审批 2=已审批 3=已驳回
|
|
|
//details: [detailsObj1],
|
|
|
}
|
|
|
//明细
|
|
|
const detailsObj1 = {
|
|
|
- projectId: null, // 所属项目id
|
|
|
- budgetPlanIds: '', // 预算计划ids
|
|
|
- frMoney: 0, // 报销金额
|
|
|
- frDate: null, // 报销时间
|
|
|
- frDesc: '', // 费用说明
|
|
|
- frType: null, // 报销类型
|
|
|
+ projectId: null, // 所属项目id
|
|
|
+ budgetPlanIds: '', // 预算计划ids
|
|
|
+ frMoney: 0, // 报销金额
|
|
|
+ frDate: null, // 报销时间
|
|
|
+ frDesc: '', // 费用说明
|
|
|
+ frType: null, // 报销类型
|
|
|
frElectronicInvoiceUrl: '', // 电子发票url地址
|
|
|
- frAttachmentUrl: '', // 附件url地址
|
|
|
+ frAttachmentUrl: '', // 附件url地址
|
|
|
}
|
|
|
|
|
|
//添加明细
|
|
@@ -311,8 +333,8 @@ const getDetailsData = async () => {
|
|
|
if (dataType.value === 'view') {
|
|
|
//预览详情
|
|
|
let newDetails = {}, newDetails1 = {}
|
|
|
- const {error, code, data, msg} = await mainApi.detail({
|
|
|
- id: dataId.value
|
|
|
+ const { error, code, data, msg } = await mainApi.detail({
|
|
|
+ id: dataId.value,
|
|
|
})
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
@@ -326,7 +348,7 @@ const getDetailsData = async () => {
|
|
|
newDetails1[key] = res[key]
|
|
|
})
|
|
|
newDetails1.id = res?.id
|
|
|
- totalFrMoney.value =Number(res?.frMoney)
|
|
|
+ totalFrMoney.value = Number(res?.frMoney)
|
|
|
newDetails.details = [newDetails1]
|
|
|
} else {
|
|
|
newDetails = detailsObj
|
|
@@ -337,8 +359,8 @@ const getDetailsData = async () => {
|
|
|
detailsData.value = newDetails
|
|
|
} else if (dataType.value === 'draft') {
|
|
|
//草稿详情
|
|
|
- const {error, code, data} = await mainApi.draftDetail({
|
|
|
- eMDraftIds: dataId.value
|
|
|
+ const { error, code, data } = await mainApi.draftDetail({
|
|
|
+ eMDraftIds: dataId.value,
|
|
|
})
|
|
|
//判断状态
|
|
|
const res = getArrValue(data)
|
|
@@ -364,17 +386,17 @@ const getDetailsData = async () => {
|
|
|
totalFrMoney.value = frMoney
|
|
|
detailsData.value = newDetails
|
|
|
} else {
|
|
|
- totalFrMoney.value =0
|
|
|
+ totalFrMoney.value = 0
|
|
|
detailsData.value = {
|
|
|
...detailsObj,
|
|
|
- details: [detailsObj1]
|
|
|
+ details: [detailsObj1],
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
totalFrMoney.value = 0
|
|
|
detailsData.value = {
|
|
|
...detailsObj,
|
|
|
- details: [detailsObj1]
|
|
|
+ details: [detailsObj1],
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -389,8 +411,8 @@ const setFormItemRefs = (el, index) => {
|
|
|
} else {
|
|
|
formRefs.value.push({
|
|
|
index: index,
|
|
|
- ref: el
|
|
|
- });
|
|
|
+ ref: el,
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -402,10 +424,10 @@ const getFormRef = async (index) => {
|
|
|
}
|
|
|
|
|
|
const formRules = {
|
|
|
- projectId: [{required: true, message: '请选择所属项目', trigger: 'change'}],
|
|
|
- frMoney: [{required: true, message: '请输入报销金额', trigger: 'blur'}],
|
|
|
- frDate: [{required: true, message: '请选择费用发生日期', trigger: 'change'}],
|
|
|
- frType: [{required: true, message: '请选择费用类型', trigger: 'change'}],
|
|
|
+ projectId: [{ required: true, message: '请选择所属项目', trigger: 'change' }],
|
|
|
+ frMoney: [{ required: true, message: '请输入报销金额', trigger: 'blur' }],
|
|
|
+ frDate: [{ required: true, message: '请选择费用发生日期', trigger: 'change' }],
|
|
|
+ frType: [{ required: true, message: '请选择费用类型', trigger: 'change' }],
|
|
|
}
|
|
|
|
|
|
//关联预算计划
|
|
@@ -422,16 +444,16 @@ const budgetModalShow = (item, index) => {
|
|
|
//关联预算计划表格
|
|
|
const tableBudgetLoading = ref(false)
|
|
|
const tableBudgetColumn = [
|
|
|
- {key: 'projectName', name: '任务所属项目'},
|
|
|
- {key: 'status', name: '状态', width: '120', align: 'center'},
|
|
|
- {key: 'planTaskDesc', name: '任务描述'},
|
|
|
- {key: 'planTarget', name: '完成指标', width: '120', align: 'center'},
|
|
|
- {key: 'action', name: '操作', width: '100', align: 'center'},
|
|
|
+ { key: 'projectName', name: '任务所属项目' },
|
|
|
+ { key: 'status', name: '状态', width: '120', align: 'center' },
|
|
|
+ { key: 'planTaskDesc', name: '任务描述' },
|
|
|
+ { key: 'planTarget', name: '完成指标', width: '120', align: 'center' },
|
|
|
+ { key: 'action', name: '操作', width: '100', align: 'center' },
|
|
|
]
|
|
|
const tableBudgetData = ref([])
|
|
|
const getBudgetTableData = async (projectId) => {
|
|
|
tableBudgetLoading.value = true
|
|
|
- const {error, code, data} = await mainApi.budget({projectId})
|
|
|
+ const { error, code, data } = await mainApi.budget({ projectId })
|
|
|
//判断状态
|
|
|
tableBudgetLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -453,22 +475,18 @@ const isRowRelevance = async (data) => {
|
|
|
|
|
|
//取消关联
|
|
|
const rowDisassociate = (row) => {
|
|
|
- const ids = budgetIds.value
|
|
|
- const index = ids.indexOf(row.id)
|
|
|
- if (index > -1) {
|
|
|
- ids.splice(index, 1)
|
|
|
- }
|
|
|
- budgetIds.value = ids
|
|
|
- console.log( budgetIds.value ,' 关联budgetIds.value ');
|
|
|
+ budgetIds.value = ''
|
|
|
row.isRelevance = false
|
|
|
}
|
|
|
|
|
|
//关联
|
|
|
const rowRelevance = (row) => {
|
|
|
- const ids = budgetIds.value
|
|
|
- ids.push(row.id)
|
|
|
+ const ids = row.id
|
|
|
budgetIds.value = ids
|
|
|
- console.log( budgetIds.value ,' 取消关联budgetIds.value ');
|
|
|
+ tableBudgetData.value.forEach((ele)=>{
|
|
|
+ ele.isRelevance = false
|
|
|
+ })
|
|
|
+
|
|
|
row.isRelevance = true
|
|
|
}
|
|
|
|
|
@@ -476,11 +494,11 @@ const rowRelevance = (row) => {
|
|
|
//确认关联预算计划
|
|
|
const budgetSaveClick = () => {
|
|
|
const index = budgetIndex.value
|
|
|
- const ids = budgetIds.value?.join('')
|
|
|
- detailsData.value.details[index].budgetPlanIds=ids
|
|
|
+ const ids = budgetIds.value
|
|
|
+ detailsData.value.details[index].budgetPlanIds = ids
|
|
|
window.$message.success('操作成功')
|
|
|
budgetModal.value = false
|
|
|
- console.log( detailsData.value.details,' detailsData.value.details');
|
|
|
+ console.log( detailsData.value.details, ' detailsData.value.details')
|
|
|
}
|
|
|
|
|
|
//关闭预算计划
|
|
@@ -500,9 +518,9 @@ const uploadFileOptions = {
|
|
|
const invoiceItemUpload = (index) => {
|
|
|
uploadEchoParams.value = {
|
|
|
name: 'frElectronicInvoiceUrl',
|
|
|
- index: index
|
|
|
+ index: index,
|
|
|
}
|
|
|
- HcUploadFileRef.value?.selectFile();
|
|
|
+ HcUploadFileRef.value?.selectFile()
|
|
|
}
|
|
|
//文件列表改变事件
|
|
|
const invoiceItemChange = (src, index) => {
|
|
@@ -514,9 +532,9 @@ const invoiceItemChange = (src, index) => {
|
|
|
const fileItemUpload = (index) => {
|
|
|
uploadEchoParams.value = {
|
|
|
name: 'frAttachmentUrl',
|
|
|
- index: index
|
|
|
+ index: index,
|
|
|
}
|
|
|
- HcUploadFileRef.value?.selectFile();
|
|
|
+ HcUploadFileRef.value?.selectFile()
|
|
|
}
|
|
|
//文件列表改变事件
|
|
|
const fileItemChange = (src, index) => {
|
|
@@ -525,14 +543,14 @@ const fileItemChange = (src, index) => {
|
|
|
}
|
|
|
|
|
|
//上传完成
|
|
|
-const HcUploadFileSuccess = ({echoParams, resData}) => {
|
|
|
+const HcUploadFileSuccess = ({ echoParams, resData }) => {
|
|
|
setUploadFileData(echoParams, resData)
|
|
|
- HcUploadFileRef.value?.setModalShow(false);
|
|
|
+ HcUploadFileRef.value?.setModalShow(false)
|
|
|
}
|
|
|
|
|
|
//使用某个文件
|
|
|
-const HcUploadFileItem = ({item}) => {
|
|
|
- const {name, index} = uploadEchoParams.value, {pdfUrl} = item.resData
|
|
|
+const HcUploadFileItem = ({ item }) => {
|
|
|
+ const { name, index } = uploadEchoParams.value, { pdfUrl } = item.resData
|
|
|
const urls = detailsData.value.details[index][name].split(',')
|
|
|
if (urls.indexOf(pdfUrl) === -1) {
|
|
|
setUploadFileData(uploadEchoParams.value, item.resData)
|
|
@@ -543,7 +561,7 @@ const HcUploadFileItem = ({item}) => {
|
|
|
|
|
|
//设置上传后的数据
|
|
|
const setUploadFileData = (echoParams, resData) => {
|
|
|
- const {name, index} = echoParams, {pdfUrl} = resData
|
|
|
+ const { name, index } = echoParams, { pdfUrl } = resData
|
|
|
let url = detailsData.value.details[index][name]
|
|
|
if (url) {
|
|
|
url += `,${pdfUrl}`
|
|
@@ -556,62 +574,62 @@ const setUploadFileData = (echoParams, resData) => {
|
|
|
//流程数据
|
|
|
//报销金额大于1000
|
|
|
const timeLineData = ref([
|
|
|
- {title: '审批人', section: '部门负责人'},
|
|
|
- {title: '财务审核', section: '财务'},
|
|
|
- {title: '最终确认付款人', section: '总经理'},
|
|
|
- {title: '出纳付款', section: '出纳'},
|
|
|
- {title: '抄送人', section: '总经理、财务、申请人'},
|
|
|
+ { title: '审批人', section: '部门负责人' },
|
|
|
+ { title: '财务审核', section: '财务' },
|
|
|
+ { title: '最终确认付款人', section: '总经理' },
|
|
|
+ { title: '出纳付款', section: '出纳' },
|
|
|
+ { title: '抄送人', section: '总经理、财务、申请人' },
|
|
|
])
|
|
|
//报销金额小于1000
|
|
|
const timeLineData1 = ref([
|
|
|
- {title: '审批人', section: '部门负责人'},
|
|
|
- {title: '付款确认', section: '财务'},
|
|
|
- {title: '出纳付款', section: '出纳'},
|
|
|
- {title: '抄送人', section: '总经理、财务、申请人'},
|
|
|
+ { title: '审批人', section: '部门负责人' },
|
|
|
+ { title: '付款确认', section: '财务' },
|
|
|
+ { title: '出纳付款', section: '出纳' },
|
|
|
+ { title: '抄送人', section: '总经理、财务、申请人' },
|
|
|
])
|
|
|
-const timeData=ref([])
|
|
|
-const getApprovesListData=async()=>{
|
|
|
- const {error, code, data} = await getApprovesList()
|
|
|
+const timeData = ref([])
|
|
|
+const getApprovesListData = async ()=>{
|
|
|
+ const { error, code, data } = await getApprovesList()
|
|
|
if (!error && code === 200) {
|
|
|
- timeData.value=data['财务报销流程']
|
|
|
- let approveArr=timeData.value['审批人']
|
|
|
+ timeData.value = data['财务报销流程']
|
|
|
+ let approveArr = timeData.value['审批人']
|
|
|
//小于1000
|
|
|
let value = '总经理'
|
|
|
let newSet = new Set(approveArr)
|
|
|
newSet.delete(value)
|
|
|
let newArr = [...newSet]
|
|
|
- let copyArr=timeData.value['抄送人']
|
|
|
- timeLineData1.value.forEach((ele,index)=>{
|
|
|
- if(ele.title!=='抄送人'){
|
|
|
- ele.section=newArr[index]
|
|
|
- }else{
|
|
|
- ele.section=copyArr.join(',')
|
|
|
+ let copyArr = timeData.value['抄送人']
|
|
|
+ timeLineData1.value.forEach((ele, index)=>{
|
|
|
+ if (ele.title !== '抄送人') {
|
|
|
+ ele.section = newArr[index]
|
|
|
+ } else {
|
|
|
+ ele.section = copyArr.join(',')
|
|
|
}
|
|
|
|
|
|
})
|
|
|
//大于1000
|
|
|
- timeLineData.value.forEach((ele,index)=>{
|
|
|
- if(ele.title!=='抄送人'){
|
|
|
- ele.section=approveArr[index]
|
|
|
- }else{
|
|
|
- ele.section=copyArr.join(',')
|
|
|
+ timeLineData.value.forEach((ele, index)=>{
|
|
|
+ if (ele.title !== '抄送人') {
|
|
|
+ ele.section = approveArr[index]
|
|
|
+ } else {
|
|
|
+ ele.section = copyArr.join(',')
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- console.log( timeLineData.value,' timeData.value');
|
|
|
+ console.log( timeLineData.value, ' timeData.value')
|
|
|
} else {
|
|
|
- timeLineData.value=[]
|
|
|
+ timeLineData.value = []
|
|
|
|
|
|
}
|
|
|
}
|
|
|
//处理表单数据
|
|
|
const getFormData = (submitStatus = 1) => {
|
|
|
const res = deepClone(detailsData.value)
|
|
|
- const cashierUser = {userId: ''} //出纳人
|
|
|
- const ccUserList = [{userId: ''}] //抄送人列表
|
|
|
- const finalConfirmationUser = {userId: ''} //最终确认付款人
|
|
|
- const financeUser = {userId: ''} //财务人员
|
|
|
- const responsibleUser = {userId: ''} //部门负责人
|
|
|
+ const cashierUser = { userId: '' } //出纳人
|
|
|
+ const ccUserList = [{ userId: '' }] //抄送人列表
|
|
|
+ const finalConfirmationUser = { userId: '' } //最终确认付款人
|
|
|
+ const financeUser = { userId: '' } //财务人员
|
|
|
+ const responsibleUser = { userId: '' } //部门负责人
|
|
|
//----处理数据----
|
|
|
let newFormData = [], newDetails = {}
|
|
|
//基础数据
|
|
@@ -629,7 +647,7 @@ const getFormData = (submitStatus = 1) => {
|
|
|
// finalConfirmationUser,
|
|
|
// financeUser,
|
|
|
// responsibleUser,
|
|
|
- submitStatus //提交状态 1=暂存 2=提交审批
|
|
|
+ submitStatus, //提交状态 1=暂存 2=提交审批
|
|
|
})
|
|
|
})
|
|
|
return newFormData
|
|
@@ -640,7 +658,7 @@ const tempLoading = ref(false)
|
|
|
const tempDraftData = async () => {
|
|
|
tempLoading.value = true
|
|
|
const form = getFormData(1)
|
|
|
- const {error, code, msg} = await mainApi.submit(form)
|
|
|
+ const { error, code, msg } = await mainApi.submit(form)
|
|
|
//判断状态
|
|
|
tempLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -664,12 +682,12 @@ const submitFormData = async () => {
|
|
|
}
|
|
|
}
|
|
|
//发起请求
|
|
|
- const {error, code, msg} = await mainApi.submit(form)
|
|
|
+ const { error, code, msg } = await mainApi.submit(form)
|
|
|
//判断状态
|
|
|
submitLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
window.$message?.success('提交成功')
|
|
|
- router.push({name: 'expense-finReimburse'})
|
|
|
+ router.push({ name: 'expense-finReimburse' })
|
|
|
} else {
|
|
|
window.$message?.error(msg)
|
|
|
}
|