完成对公收款对接

main-20240105
123456 8 months ago
parent 0ac862d77c
commit 4f28b87e88

@ -5,7 +5,8 @@ ENV = 'development'
VUE_APP_TITLE = 链友融财务数字一体化信息系统
# 链友融财务数字一体化信息系统/开发环境
VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'
# VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'
VUE_APP_BASE_API = 'https://351009q0x9.oicp.vip'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -0,0 +1,54 @@
import request from '@/plugin/axios'
// 创建银行账户信息
export function createBankAccountInfo(data) {
return request({
url: "/bs/bank-account-info/create",
method: "post",
data: data,
});
}
// 更新银行账户信息
export function updateBankAccountInfo(data) {
return request({
url: "/bs/bank-account-info/update",
method: "put",
data: data,
});
}
// 删除银行账户信息
export function deleteBankAccountInfo(id) {
return request({
url: "/bs/bank-account-info/delete?id=" + id,
method: "delete",
});
}
// 获得银行账户信息
export function getBankAccountInfo(id) {
return request({
url: "/bs/bank-account-info/get?id=" + id,
method: "get",
});
}
// 获得银行账户信息分页
export function getBankAccountInfoPage(query) {
return request({
url: "/bs/bank-account-info/page",
method: "get",
params: query,
});
}
// 导出银行账户信息 Excel
export function exportBankAccountInfoExcel(query) {
return request({
url: "/bs/bank-account-info/export-excel",
method: "get",
params: query,
responseType: "blob",
});
}

@ -42,9 +42,9 @@
</div>
</div>
<div class="box-rt">
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:show']" @click="handleShow(itemData.id)" name="eye-o" color="#05A9FF" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:update']" @click="handleEdit(itemData.id, itemData.status)" name="edit" :color="itemData.status!=0 && itemData.status!=3 ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:delete']" @click="handleDel(itemData.id, itemData.status)" name="delete-o" :color="itemData.status!=0 && itemData.status!=3 ?'#ccc':'#EC3359'" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:vendor-receipt:query']" @click="handleShow(itemData.id)" name="eye-o" color="#05A9FF" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:vendor-receipt:update']" @click="handleEdit(itemData.id, itemData.status)" name="edit" :color="itemData.status!=0 && itemData.status!=3 ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:vendor-receipt:delete']" @click="handleDel(itemData.id, itemData.status)" name="delete-o" :color="itemData.status!=0 && itemData.status!=3 ?'#ccc':'#EC3359'" size="25" />
<!-- <van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:delete']" @click="handleMerge(itemData.id, itemData.status)" name="envelop-o" :color="itemData.status!=0 && itemData.status!=3 ?'#05A9FF':'#ccc'" :size="25" /> -->
</div>
</div>
@ -54,7 +54,7 @@
<script>
import { getDictDataLabel, handleFilterStatus } from "@/utils/dict";
import { deleteSupplierContract } from '@/api/bs/supplierContract';
import { deleteVendorReceipt } from "@/api/bs/vendorReceipt"
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -98,7 +98,7 @@ export default {
}
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
path: '/receipts',
query: { id, type: 'edit' }
})
},
@ -111,7 +111,7 @@ export default {
message: '你确定要删除吗?',
})
.then(() => {
deleteSupplierContract(id).then(() => {
deleteVendorReceipt(id).then(() => {
this.$emit('onAllRefresh')
})
})
@ -121,7 +121,7 @@ export default {
handleShow(id) {
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
path: '/receipts',
query: { id, type: 'show' }
})
},

@ -2,19 +2,19 @@
<div id="orderHeader">
<div class="hf-l-seacrch" v-if="isActSearch">
<form action="/">
<van-search v-model="listQuery.contractNumber" shape="round" show-action placeholder="请输入合同编号" :clearable="false" @search="onKeywordSearch" @cancel="onKeywordCancel" />
<van-search v-model="listQuery.vendorPaymentNo" shape="round" show-action placeholder="请输入收款编号" :clearable="false" @search="onKeywordSearch" @cancel="onKeywordCancel" />
</form>
</div>
<div class="header-filter" :style="isActSearch ? 'padding: 0 0 0 0.5rem' : ''">
<div class="hf-l-list" v-show="!isActSearch">
<van-dropdown-menu class="hf-l-list-menu">
<!-- 供应商名称 -->
<van-dropdown-item title="供应商名称" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<van-dropdown-item title="账户类型" :title-class="isHtab1 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem1">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<div class="hr-drop-filter-item" @click.stop="handleClass1(item.id)" v-for="item in spList" :key="item.value">
<van-icon v-if="listQuery.supplierId && listQuery.supplierId == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.supplierId && listQuery.supplierId == item.id }">{{item.companyAme}}</span>
<div class="hr-drop-filter-item" @click.stop="handleClass1(item.value)" v-for="item in accountList" :key="item.value">
<van-icon v-if="listQuery.accountType && listQuery.accountType == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.accountType && listQuery.accountType == item.value }">{{item.label}}</span>
</div>
</div>
<div class="common-double-button">
@ -24,12 +24,12 @@
</div>
</van-dropdown-item>
<!-- 类别 -->
<van-dropdown-item title="合同状态" :title-class="isHtab4 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem4">
<van-dropdown-item title="状态" :title-class="isHtab4 ? 'common-act-color' : ''" @open="handleDropOpen()" ref="vanDropItem4">
<div class="hf-drop-view">
<div class="hf-drop-contain">
<div class="hr-drop-filter-item" @click.stop="handleClass2(item.value)" v-for="item in stateList" :key="item.value">
<van-icon v-if="listQuery.contractType && listQuery.contractType == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.contractType && listQuery.contractType == item.value }">{{item.label}}</span>
<van-icon v-if="listQuery.status && listQuery.status == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.status && listQuery.status == item.value }">{{item.label}}</span>
</div>
</div>
<div class="common-double-button">
@ -74,19 +74,19 @@
</template>
<script>
import { mapState, mapGetters } from 'vuex'
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { dayTextFormatter } from '@/utils'
import dayjs from 'dayjs'
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
export default {
props: {
listType: String, // 'detail'
paramProp: Object,
spList: Array, //
spList: Array, //
},
components: {
RePick: () => import('@/components/ReComponents/RePick'),
},
data() {
return {
defaultDate: null,
@ -103,14 +103,17 @@ export default {
}
},
computed: {
accountList() {
return getDictDatas(DICT_TYPE.BS_BANK_TYPE) || []
},
isHtab1() {
let isShow = false
if (this.paramProp.supplierId) isShow = true
if (this.paramProp.accountType) isShow = true
return isShow
},
isHtab4() {
let isShow = false
if (this.paramProp.contractType) isShow = true
if (this.paramProp.status) isShow = true
return isShow
},
areaTree() {
@ -157,7 +160,7 @@ export default {
},
onKeywordCancel() {
this.listQuery.contractNumber = null
this.listQuery.vendorPaymentNo = null
this.isActSearch = false
this.isSearch = false
this.onKeywordSearch()
@ -169,10 +172,10 @@ export default {
//
handleClass1(val) {
this.listQuery.supplierId = val
this.listQuery.accountType = val
},
handleClass2(val) {
this.listQuery.contractType = val
this.listQuery.status = val
},
// type : 1 2 3
handleState(val, type) {
@ -201,6 +204,7 @@ export default {
this.listQuery = {
...this.paramProp
}
console.log('listQuery...', this.listQuery);
if (!(this.listQuery.startDate && this.listQuery.endDate)) {
this.handleDateReset()
}
@ -214,12 +218,12 @@ export default {
//
handleSearch() {
this.handleInit()
this.listQuery.contractNumber = this.paramProp.contractNumber
this.listQuery.vendorPaymentNo = this.paramProp.vendorPaymentNo
this.isActSearch = true
},
handleSearchCancel() {
this.listQuery.contractNumber = null
this.listQuery.vendorPaymentNo = null
this.isActSearch = false
this.onKeywordSearch()
},
@ -238,8 +242,8 @@ export default {
this.moreFilterShow = false
},
handleReset() {
this.listQuery.contractType = null
this.listQuery.supplierId = null
this.listQuery.status = null
this.listQuery.accountType = null
},

@ -13,7 +13,7 @@
<span>回到顶部</span>
</div>
</div>
<div class="common-bottom-btns" v-hasPermi="['bs:supplier-contract:create']" style="bottom:10rem">
<div class="common-bottom-btns" v-hasPermi="['bs:vendor-receipt:create']" style="bottom:10rem">
<div class="common-bottom-btn" @click="handleToAdd">
<img src="@/assets/images/icons/add.png" alt="">
<span>添加收款</span>
@ -54,28 +54,26 @@ export default {
listQuery: {
pageNo: 1,
pageSize: 10,
contractNumber: null,
status: null,
supplierId: null,
contractName: null,
contractType: null,
supplierName: null,
status: null,
amount: null,
receivedAmount: null,
projectId: null,
accountType: null,
projectName: null,
startTime: [],
endTime: [],
departmentId: null,
signatoryId: null,
isCollect: null,
managerPhone: null,
approvalStatus: null,
vendorName: null,
vendorCode: null,
vendorNature: null,
deptId: null,
createName: null,
creditCode: null,
address: null,
businessStratDate: [],
businessEndDate: [],
capital: null,
address: null,
bankNumber: null,
bankOfDeposit: null,
isRegister: null,
status: null,
remark: null,
files: null,
other: null,
createTime: [],
processInstanceId: null,
},
}
},

@ -1,20 +1,20 @@
<template>
<!-- 供应商合同 -->
<div>
<UserList listType="mySupplier" ref="userList" />
<UserList listType="corporateReceipts" ref="userList" />
</div>
</template>
<script>
export default {
name: 'contract-mySupplier',
name: 'contract-corporateReceipts',
created() {
//
this.$EventBus.$emit('handleAddLive', 'contract-mySupplier')
this.$EventBus.$emit('handleAddLive', 'contract-corporateReceipts')
},
activated() {
//
this.$EventBus.$emit('handleResetLive', 'contract-supplier')
this.$EventBus.$emit('handleResetLive', 'contract-receipts')
},
components: {
UserList: () => import('./components/UserList')

@ -1,191 +0,0 @@
<template>
<van-popup v-model="isShow" position="bottom" round safe-area-inset-bottom lock-scroll lazy-render get-container="#app" :close-on-click-overlay="false">
<div class="Re-select-header">
<div class="Re-select-header-cancel" @click="hanleCancel"></div>
<div class="Re-select-header-title">报销规则</div>
<div class="Re-select-header-confirm" @click="handleConfirm"></div>
</div>
<div class="box-1">
<van-field v-model="dataObj.dept" class="actived-disabled" disabled label="费用归属部门" clear-trigger="always" input-align="right" />
<van-field v-model="dataObj.area" class="actived-disabled" disabled label="目的地" clear-trigger="always" input-align="right" />
<van-field v-model="dataObj.feetypeName" class="actived-disabled" disabled label="费用类型" clear-trigger="always" input-align="right" />
<van-field v-model="dataObj.maxMoney" class="actived-disabled" disabled label="限制额度" clear-trigger="always" input-align="right" />
</div>
</van-popup>
</template>
<script>
import dayjs from 'dayjs';
import { ImagePreview } from 'vant';
export default {
props: {
dataObj: Object,
isOpen: Boolean,
typeStr: String,
},
components: {
},
//
computed: {
// tableList() {
// let arr = (this.list || []).map(item => {
// return {
// ...item,
// checked: (this.invoiceIds || []).includes(item.id)
// }
// })
// console.log('arr', arr, this.invoiceIds);
// return arr
// },
userDeptTree() {
return this.$store.getters.userDeptTree
},
userList() {
return this.$store.getters.userList
},
},
data() {
return {
tableList: [],
demo: false,
isShow: false,
}
},
watch: {
isOpen: {
handler(val) {
this.isShow = val
if (val) {
this.handleInitList()
}
},
deep: true,
immediate: true
},
},
methods: {
handleSetCheck(index) {
// this.tableList
this.$set(this.tableList[index], 'checked', !this.tableList[index].checked)
},
handleShowImg() {
ImagePreview(['https://img01.yzcdn.cn/vant/apple-1.jpg']);
},
dayjs,
handleNewDel(index) {
this.tableList.splice(index, 1)
},
handleInitList() {
},
handleConfirm() {
let arr = (this.tableList.filter(item => item.checked)).map(item => item.id) || []
this.$emit('onConfirm', arr)
},
hanleCancel() {
this.$emit('onCancel')
},
handleDel(index) {
this.form.tripPartners.splice(index, 1)
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .actived-disabled {
.van-field__control:disabled {
color: #333 !important;
-webkit-text-fill-color: #333 !important;
}
.van-field__label {
color: #333 !important;
-webkit-text-fill-color: #333 !important;
}
}
.Re-select-header {
display: flex;
justify-content: space-between;
align-items: center;
.Re-select-header-cancel {
color: #f56c6c;
padding: 8px 14px;
&:active {
background: #eeeeee;
}
}
.Re-select-header-title {
color: #333333;
}
.Re-select-header-confirm {
color: #409eff;
padding: 8px 14px;
&:active {
background: #eeeeee;
}
}
}
.top-btn {
display: flex;
justify-content: space-between;
font-size: 1rem;
position: absolute;
}
.box-2 {
margin-top: 1rem;
box-sizing: border-box;
padding: 0.5rem 1rem;
padding-top: 0;
max-height: 50vh;
overflow: auto;
.box-top {
display: flex;
justify-content: space-between;
margin: 0.8rem 0;
.box-lf {
font-size: 1rem;
}
}
.add-box {
width: 100%;
margin-top: 0.6rem;
.van-button {
width: 100%;
// border-radius: 0.5rem;
}
}
}
.box-1 {
@extend .box-2;
.new-item-box {
width: 100%;
display: flex;
justify-content: flex-start;
box-sizing: border-box;
// padding: 0.5rem;
margin: 0.5rem 0;
border-radius: 0.5rem;
box-shadow: 0 0 0.5rem 0.2rem #ccc;
align-items: center;
padding: 0.5rem;
.new-lf {
display: flex;
margin-right: 0.8rem;
}
.new-cr {
width: 13rem;
display: flex;
flex-direction: column;
// margin-left: ;
}
}
}
::v-deep .van-image__img {
border-radius: 100%;
margin: 0 0.5rem;
}
</style>

@ -5,14 +5,19 @@
<div class="section"> <span class="line"> </span> 基本信息</div>
<div class="trips-box">
<div class="item-box">
<van-field v-model="form.claimNo" v-if="form.vendorReceiptNo" disabled label="单号" clear-trigger="always" input-align="right" />
<van-field v-model="form.vendorReceiptNo" v-if="form.vendorReceiptNo" disabled label="单号" clear-trigger="always" input-align="right" />
<van-field v-model="cn" disabled label="公司名称" clear-trigger="always" input-align="right" />
<van-field v-model="form.projectName" :disabled="disabled" label="项目名称" clear-trigger="always" placeholder="请输入" input-align="right" />
<van-field v-model="userInfo.nickname" disabled label="申请人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<van-field v-model="userInfo.dept.name" disabled label="申请部门" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<RePick v-model="form.accountType" :disabled="disabled" label="账户类型" name="accountType" :list="accountList" title="账户类型" titleKey="label" idKey="value" isCell clearable />
<RePick v-model="form.currency" :disabled="disabled" label="收取币种" name="currency" :list="moneyList" title="收取币种" titleKey="label" idKey="value" isCell clearable />
<van-field v-model="form.amount" type="number" name="amount" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="收款金额" />
<RePick v-model="form.vendorIds" :disabled="disabled" label="关联供应商" name="currency" :list="allGysList" title="关联供应商" isCell clearable />
<van-field v-model="form.amount" type="number" name="amount" :disabled="disabled" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '收款金额格式错误',validator: VerifyFunc.validatorMoney }]" label="收款金额" />
<van-field v-model="form.projectManager" :disabled="disabled" label="项目负责人" placeholder="请输入" clear-trigger="always" input-align="right" />
<RePick v-model="form.vendorIds" isRequrie :rules="[{ required: true, message: '请选择' }]" required :disabled="disabled" label="关联供应商" name="vendorIds" isShowSearch :list="allGysList" title="关联供应商" :isUseLimitPage="allGysList.length > 300" isCell clearable />
<RePick v-model="form.receiptBankIds" isRequrie :rules="[{ required: true, message: '请选择' }]" required :disabled="disabled" label="关收款账户" name="currency" isShowSearch :list="allBankList" title="关收款账户" :isUseLimitPage="allBankList.length > 300" isCell clearable />
<van-field v-model="form.reason" placeholder="请输入" :disabled="disabled" autosize rows="1" type="textarea" label="申请事由" clear-trigger="always" input-align="right" />
<van-field v-model="form.remark" placeholder="请输入" :disabled="disabled" autosize rows="1" type="textarea" label="备注信息" clear-trigger="always" input-align="right" />
</div>
</div>
<div class="section mt5"> <span class="line"> </span>附件</div>
@ -23,46 +28,27 @@
</div>
<div class="section mt5" v-if="['show'].includes(typeStr)"> <span class="line"> </span>审批流程</div>
<ApprovalProcess v-if="['show'].includes(typeStr)" :processInstanceId="form.processInstanceId" @onSetId="handleSetAccessId" />
<!-- 申请单关联 -->
<div class="section mt5"> <span class="line"> </span>申请单关联</div>
<RePick v-model="form.expenseApplyIds" isShowSearch :disabled="disabled" inputAlign="left" multiple titleKey="title" idKey="id" label="申请单" :name="`expenseApplyIds`" :list="expenseApplyList" isCell clearable />
<div class="section mt5" v-if="form.budgetAmountInfo"> <span class="line"> </span>预算信息提示</div>
<div style="color:red;font-size:0.8rem;margin-top:0.5rem" v-if="form.budgetAmountInfo">
{{form.budgetAmountInfo}}
</div>
</van-form>
</div>
<BottomBtn ref="BottomBtn" :isAuthorised="isAuthorised" @onBtConfirm="handleBtConfirm" :accessId="accessId" />
<!--行程时间范围选择 -->
<van-calendar ref="vanCalendar" allow-same-day :maxDate="maxDate" v-model="dateShow" :min-date="minDate" :default-date="defaultDate" type="range" color="#0088FE" @confirm="handleDateSelect" />
<!-- 报销规则 -->
<Rules :dataObj="dialogObj" :typeStr="typeStr" @onCancel="isShow = false" :isOpen="isShow" @onConfirm="(arr)=>{isShow = false}" />
</div>
</template>
<script>
import dayjs from 'dayjs';
import { createExpenseClaim, findClaimRules, getExpenseClaim, getMyExpenseClaim } from "@/api/bs/expenseClaim";
import { getInvoicePage } from "@/api/bs/invoice";
import { listData } from "@/api/system/dict/data";
import { createVendorReceipt, getVendorReceipt, updateVendorReceipt } from "@/api/bs/vendorReceipt";
import VerifyFunc from '@/utils/verify'
import { getTreeIds, findAreaIdName } from '@/utils'
import { getExpenseApplyMyPage } from "@/api/bs/expenseApply";
import { Dialog } from 'vant'
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getVendorPage } from "@/api/bs/vendor";
import { getBankAccountInfoPage } from "@/api/bs/bankAccountInfo";
export default {
//import使
props: {},
name: 'company-claim',
name: 'contract-receipts',
components: {
BottomBtn: () => import('@/components/BottomBtn'),
ApprovalProcess: () => import('@/components/ApprovalProcess'),
RePick: () => import('@/components/ReComponents/RePick'),
FollowPeoPle: () => import('@/components/FollowPeoPle'),
ConnectInvoice: () => import('@/components/ConnectInvoice'),
UploadFile: () => import('@/components/UploadFile'),
Rules: () => import('./components/Rules'),
},
// 访this
created() {
@ -75,16 +61,11 @@ export default {
},
data() {
return {
form: {},
allBankList: [],
allGysList: [],
indexOne: 1,
indexTwo: 1,
claimType: '',
expenseApplyList: [],
isShow: false,
dialogObj: {},
isAuthorised: false,
accessId: null,
ieList: [], //
VerifyFunc,
isAuthority: 0,
typeStr: null, // show: edit: :
@ -95,59 +76,6 @@ export default {
{ title: '同意', icon: 'certificate', color: "#19be6b", key: 2 },
{ title: '驳回', icon: 'exchange', color: "#fa3534", key: 3 },
],
tripTypeList: [], //
feeTypeList: [], //
index: 0,
minDate: new Date('2000/01/01'),
maxDate: new Date('2030/01/01'),
defaultDate: new Date(),
dateShow: false,
form: {
applyNo: null,
projectName: null,
reason: null,
remark: null,
costDeptId: null,
expenseApplyIds: [],
expenseClaimTrips: [
{
time: '',
startTime: null,
endTime: null,
departureLocation: null,
destinationLocation: null,
tripDay: undefined,
tripType: null,
tripPartners: [], //
amount: undefined,
expenseClaimDetails: [
{
show: false,
invoiceName: '',
ieList: this.ieList,
invoiceIds: {},
feeType: null,
amount: undefined,
invoiceCount: undefined,
remark: null,
}
]
}
],
//
expenseClaimDetails: [
{
show: false,
invoiceName: '',
ieList: this.ieList,
invoiceIds: {},
feeType: null,
amount: undefined,
invoiceCount: undefined,
remark: null,
}
]
},
};
},
//
@ -159,15 +87,6 @@ export default {
moneyList() {
return getDictDatas(DICT_TYPE.CURRENCY_TYPE) || []
},
allTripPartners() {
let arr = []
this.form.expenseClaimTrips.forEach(v => {
v.tripPartners.forEach(z => {
arr.push(z)
})
})
return arr
},
areaTree() {
return this.$store.getters.areaTree
},
@ -185,96 +104,12 @@ export default {
},
disabled() {
return ['show'].includes(this.$route.query.type)
}
},
CLBX() {
return ['CLBX'].includes(this.$route.query.billType)
},
RCBX() {
return ['RCBX'].includes(this.$route.query.billType)
},
},
// data
watch: {},
//
methods: {
handleCountAmount(list) {
//
let res = (list || []).filter(item => item.feeManageAmount)
if (res.length) {
let arr = list.map(item => item.feeManageAmount || 0)
return arr.reduce((total, num) => Number(total) + Number(num), 0);
} else {
return 999999999999999999
}
},
unique(arr) {
let newArr = [arr[0]]
for (let i = 1; i < arr.length; i++) {
if (arr[i] !== newArr[newArr.length - 1]) {
newArr.push(arr[i])
}
}
return newArr
},
showRules(obj, index, nIndex) {
let msgObj = this.form.expenseClaimTrips[index] || {}
let msgObj2 = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex] || {}
const { destinationLocation } = msgObj
const { feeType } = msgObj2
if (!destinationLocation || !feeType || !this.form.costDeptId) {
return this.$fm('请选择行程目的地,费用类型,费用归属部门!')
}
findClaimRules({
destinationLocation: Array.isArray(destinationLocation) ? destinationLocation[destinationLocation.length - 1] : destinationLocation,
feeType,
costDeptId: this.form.costDeptId
}).then((res) => {
this.dialogObj = {
dept: getTreeIds(this.userDeptTree, this.form.costDeptId).join('-'),
area: getTreeIds(this.areaTree, Array.isArray(destinationLocation) ? destinationLocation[destinationLocation.length - 1] : destinationLocation).join('-'),
feetypeName: this.feeTypeList.find(item => item.value == feeType).label,
maxMoney: res.data === 0 || res.data ? res.data : '未设置'
}
this.isShow = true
})
},
// showRules1(obj, index, nIndex) {
// let msgObj = this.form.expenseClaimTrips[index] || {}
// let msgObj2 = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex] || {}
// const { destinationLocation } = msgObj
// const { feeType } = msgObj2
// if (!destinationLocation || !feeType || !this.form.costDeptId) {
// return this.$fm('')
// }
// findClaimRules({
// destinationLocation: Array.isArray(destinationLocation) ? destinationLocation[destinationLocation.length - 1] : destinationLocation,
// feeType,
// costDeptId: this.form.costDeptId
// }).then((res) => {
// this.dialogObj = {
// dept: getTreeIds(this.userDeptTree, this.form.costDeptId).join('-'),
// area: getTreeIds(this.areaTree, Array.isArray(destinationLocation) ? destinationLocation[destinationLocation.length - 1] : destinationLocation).join('-'),
// feetypeName: this.feeTypeList.find(item => item.value == feeType).label,
// maxMoney: res.data === 0 || res.data ? res.data : ''
// }
// this.isShow = true
// })
// },
handleClear(index, type) {
if (type === 1) {
this.$set(this.form.expenseClaimTrips[index], 'time', null)
} else {
this.$set(this.form.expenseClaimTrips[index], 'tripPartners', [])
this.$set(this.form.expenseClaimTrips[index], 'tripPartnersName', null)
}
},
handleShowRules() {
handleUpload(list) {
this.fileList = list
},
handleBtConfirm(key, ignoreFeeTip) {
if (key == 2 || key == 3) {
@ -286,68 +121,28 @@ export default {
let newForm = {
...this.form,
files: this.fileList,
billType: this.$route.query.billType,
ignoreFeeTip,
receiptBankIds: [this.form.receiptBankIds],
vendorIds: [this.form.vendorIds],
status: key
}
if (this.$route.query.billType === 'RCBX') {
delete newForm.expenseClaimTrips
} else {
delete newForm.expenseClaimDetails
}
if (ignoreFeeTip) {
this.$loading(true, 'form')
createExpenseClaim(newForm).then(() => {
let api = newForm.id ? updateVendorReceipt : createVendorReceipt
api(newForm).then(() => {
this.$loading(false, 'form')
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
//
if (!newForm.id) {
this.$EventBus.$emit('handleResetLive', 'company-myClaim')
this.$EventBus.$emit('handleResetLive', 'company-myNewClaim')
this.$EventBus.$emit('handleResetLive', 'contract-corporateReceipts')
}
history.back()
}).catch(() => {
this.$loading(false, 'form')
})
} else {
this.$loading(false, 'form')
createExpenseClaim(newForm).then((response) => {
if (response.msg) {
if (!response.data) {
Dialog.confirm({
title: '提示',
message: `${response.msg} 您确认要提交吗?`,
}).then(() => {
this.handleBtConfirm(key, 1)
})
}
} else {
this.$loading(false, 'form')
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
//
if (!newForm.id) {
this.$EventBus.$emit('handleResetLive', 'company-myClaim')
this.$EventBus.$emit('handleResetLive', 'company-myNewClaim')
}
history.back()
}
}).catch(() => {
this.$loading(false, 'form')
})
}
// createExpenseClaim(newForm).then(() => {
// this.$loading(false, 'form')
// this.$sm(`${this.form.id ? '!' : '!'}`)
// //
// if (!newForm.id) {
// this.$EventBus.$emit('handleResetLive', 'company-myClaim')
// }
// history.back()
// });
}).catch((err) => {
console.log('err..', err);
this.$loading(false, 'form')
if (err && err.length > 0 && err[0].name) {
this.$fm(err[0].message)
const fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
const fieldHeight = fieldElement.offsetHeight;
const scrollHeight = fieldHeight + 50; // 50px
@ -359,154 +154,18 @@ export default {
handleSetAccessId(id) {
this.accessId = id
},
handleNitemAmount(e, index) {
this.VerifyFunc.validatorMoney(e.target.value, { required: true }).then((res) => {
if (!res) {
this.$fm('金额格式错误!')
} else {
let arr = this.form.expenseClaimTrips[index].expenseClaimDetails.map(item => item.amount)
let total = arr.reduce((pre, cur) => {
return parseFloat(pre) + parseFloat(cur)
}, 0)
this.$set(this.form.expenseClaimTrips[index], 'amount', total.toFixed(2))
}
})
},
handleNitemAmount1(e, index) {
this.VerifyFunc.validatorMoney(e.target.value, { required: true }).then((res) => {
if (!res) {
this.$fm('金额格式错误!')
} else {
let arr = this.form.expenseClaimDetails.map(item => item.amount)
let total = arr.reduce((pre, cur) => {
return parseFloat(pre) + parseFloat(cur)
}, 0)
this.$set(this.form.expenseClaimDetails[index], 'amount', total.toFixed(2))
}
})
},
handleAcDel(index, nIndex) {
this.form.expenseClaimTrips[index].expenseClaimDetails.splice(nIndex, 1)
},
handleAcDel1(nIndex) {
this.form.expenseClaimDetails.splice(nIndex, 1)
},
handleFilterList(ids, type) {
return new Promise((resolve) => {
let arr = []
// if (!type) {
// this.form.expenseClaimTrips.forEach(item => {
// item.expenseClaimDetails.forEach(n => {
// n.invoiceIds.forEach(z => {
// arr.push(z)
// })
//
// })
// })
// } else {
// this.form.expenseClaimDetails.forEach(n => {
// n.invoiceIds.forEach(z => {
// arr.push(z)
// })
//
// })
// }
let beforeIds = this.ieList.filter(item => !arr.includes(item.id)) || []
let noewIds = this.ieList.filter(item => ids.includes(item.id)) || []
resolve(beforeIds.concat(noewIds))
})
},
handleShowIe(type, index, nIndex) {
if (this.disabled) return
// this.indexOne = index
// this.indexTwo = nIndex
// this.claimType = type
// let obj = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex]
// this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'ieList', arr)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', true)
console.log('form......', this.form);
// this.handleFilterList(obj.invoiceIds || {}).then((arr) => {
//
// })
},
handleShowIe1(nIndex) {
if (this.disabled) return
// let obj = this.form.expenseClaimDetails[nIndex]
// this.$set(this.form.expenseClaimDetails[nIndex], 'ieList', arr)
this.$set(this.form.expenseClaimDetails[nIndex], 'show', true)
// this.handleFilterList(obj.invoiceIds || {}, 1).then((arr) => {
//
// })
},
handleConfirmIe(arr, index, nIndex) {
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceIds', arr)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', false)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr))
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', '已关联发票')
},
handleConfirmIe1(arr, nIndex) {
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceIds', arr)
this.$set(this.form.expenseClaimDetails[nIndex], 'show', false)
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceCount', this.totalCount(arr))
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceName', '已关联发票')
},
totalCount(obj) {
let count = 0;
for (let key in obj) {
if (Array.isArray(obj[key])) {
count += obj[key].length;
}
}
return count;
},
totalName(obj) {
let count = '';
for (let key in obj) {
if (Array.isArray(obj[key])) {
obj[key].forEach(function (item) {
count = !count ? item : count + `${item}`
})
}
}
return count;
},
handleAddAccount(pIndex, index) {
this.form.expenseClaimTrips[pIndex].expenseClaimDetails.push({
invoiceIds: {},
feeType: null,
amount: undefined,
invoiceCount: undefined,
remark: null,
})
},
handleAddAccount1() {
this.form.expenseClaimDetails.push({
invoiceIds: {},
feeType: null,
amount: undefined,
invoiceCount: undefined,
remark: null,
})
},
handleInitForm() {
const { id, type, listType } = this.$route.query || {}
this.typeStr = type
this.typeStr = this.$route.query.type
//
this.$EventBus.$emit('handleAddLive', 'company-claim')
if (id) {
this.$EventBus.$emit('handleAddLive', 'contract-receipts')
if (this.$route.query.id) {
this.$loading(true, 'loadingSb')
let api = listType === 'myNewClaim' ? getMyExpenseClaim : getExpenseClaim
api(id).then((res) => {
let api = getVendorReceipt
api(this.$route.query.id).then((res) => {
this.form = {
...(res.data || {}),
receiptBankIds: Array.isArray(res.data.receiptBankIds) && res.data.receiptBankIds.length ? Number(res.data.receiptBankIds[0]) : null,
vendorIds: Array.isArray(res.data.vendorIds) && res.data.vendorIds.length ? Number(res.data.vendorIds[0]) : null
}
this.fileList = res.data.files || []
this.isAuthorised = res.data.isAuthorised
@ -520,7 +179,6 @@ export default {
},
handleInitList() {
console.log('......');
this.$loading(true)
return new Promise((resolve) => {
Promise.all([
@ -528,54 +186,25 @@ export default {
getBankAccountInfoPage({ pageNo: 1, pageSize: 999 })
]).then(responses => {
//
this.allGysList = responses[0].data.list || [];
this.allBankList = responses[1].data.list || [];
this.allGysList = (responses[0].data.list || []).map(item => {
return {
id: item.id,
title: item.vendorName
}
});
this.allBankList = (responses[1].data.list || []).map(item => {
return {
id: item.id,
title: `${item.bankName}-${item.bankAccount}`
}
});
resolve()
}).catch(error => {
//
console.error('Error:', error);
});
})
},
handleDateShow(index, obj) {
if (this.disabled) {
return
}
const { startTime, endTime } = obj
this.$nextTick(() => {
this.$refs.vanCalendar && this.$refs.vanCalendar.reset()
this.dateShow = true
this.index = index
if (startTime && endTime) {
this.defaultDate = [dayjs(startTime).toDate(), dayjs(endTime).toDate()]
}
})
},
handleDateSelect(list) {
let trips = this.form.expenseClaimTrips
if (trips.length && list && list.length) {
//
let start1 = dayjs(list[0]);
let end1 = dayjs(list[1]);
let range1 = { start: start1, end: end1 };
for (let i = 0; i < trips.length; i++) {
let start2 = dayjs(trips[i].startTime);
let end2 = dayjs(trips[i].endTime);
let range2 = { start: start2, end: end2 };
if (this.index !== i && range1.start.isBefore(range2.end) && range2.start.isBefore(range1.end)
) {
this.$set(this.form.expenseClaimTrips[this.index], 'time', null)
return this.$fm(`行程时间范围与行程${i + 1}时间范围冲突!`)
}
}
}
this.$set(this.form.expenseClaimTrips[this.index], 'time', `${dayjs(list[0]).format('YY/MM/DD')}~${dayjs(list[1]).format('YY/MM/DD')}`)
this.$set(this.form.expenseClaimTrips[this.index], 'startTime', dayjs(list[0]).valueOf())
this.$set(this.form.expenseClaimTrips[this.index], 'endTime', dayjs(list[1]).valueOf())
let day = list && list.length && Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1
this.$set(this.form.expenseClaimTrips[this.index], 'tripDay', day)
this.dateShow = false
},
},
}
</script>

Loading…
Cancel
Save