完成对公收款

main-20240105
赵夫琳 8 months ago
parent 4f28b87e88
commit a2824c54a6

@ -12,44 +12,39 @@
</div>
<div class="ct-md">
<div class="mt5" style="color:#333">
收款编号 {{itemData.contractNumber}}
付款编号 {{itemData.vendorPaymentNo}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
申请人{{itemData.contractName}}
申请人{{itemData.createName}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
申请部门{{itemData.supplierName}}
申请部门{{itemData.deptName}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
项目名称{{itemData.signatoryName}}
项目名称{{itemData.projectName}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
项目负责人{{itemData.amount}}
项目负责人{{itemData.projectManager}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
账户类型{{itemData.amount}}
付款类型{{getDictDataLabel(DICT_TYPE.BS_BANK_TYPE,itemData.receiptType) || ''}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
款金额{{itemData.amount}}
款金额{{itemData.amount}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
审批节点{{itemData.amount}}
审批节点
<span v-for="(items,index) in itemData.taskNames" :key="index">{{ items }} </span>
</div>
<div style="margin-top: 0.3rem;color:#333 ">
审批状态{{itemData.amount}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
创建时间{{itemData.amount}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
<div class="tags" :style="`border: 1px solid ;color:#05A9FF;width: 6rem;`">{{getDictDataLabel(DICT_TYPE.SR_CT_TYPE,itemData.contractType) || '未知'}} </div>
创建时间{{ dayjs(itemData.createTime).format('YYYY/MM/DD')}}
</div>
</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-payment:query']" @click="handleShow(itemData.id)" name="eye-o" color="#05A9FF" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:vendor-payment: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-payment: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>
@ -59,7 +54,7 @@
<script>
import { getDictDataLabel, handleFilterStatus } from "@/utils/dict";
import { deleteSupplierContract } from '@/api/bs/supplierContract';
import { deleteVendorPayment } from "@/api/bs/vendorPayment"
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -103,7 +98,7 @@ export default {
}
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
path: '/payment',
query: { id, type: 'edit' }
})
},
@ -116,7 +111,7 @@ export default {
message: '你确定要删除吗?',
})
.then(() => {
deleteSupplierContract(id).then(() => {
deleteVendorPayment(id).then(() => {
this.$emit('onAllRefresh')
})
})
@ -126,7 +121,7 @@ export default {
handleShow(id) {
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
path: '/payment',
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.receiptType && listQuery.receiptType == item.value" name="success" color="#0088FE" />
<span :class="{'hr-drop-filter-item-act': listQuery.receiptType && listQuery.receiptType == 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.receiptType) 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.receiptType = 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.receiptType = null
},

@ -1,5 +1,5 @@
<template>
<!-- 中标审批列表 -->
<!-- 对公收款 -->
<div>
<HeaderFilter :listType="listType" :spList="spList" @onListQuery="handleListQuery" :paramProp="listQuery" />
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
@ -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-payment:create']" style="bottom:10rem">
<div class="common-bottom-btn" @click="handleToAdd">
<img src="@/assets/images/icons/add.png" alt="">
<span>添加付款</span>
@ -54,28 +54,25 @@ 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,
receiptType: 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,
bankNumber: null,
bankOfDeposit: null,
isRegister: null,
status: null,
remark: null,
files: null,
other: null,
createTime: [],
processInstanceId: null,
},
}
},
@ -157,7 +154,7 @@ export default {
},
handleToAdd() {
this.$router.push({
path: '/supplier',
path: '/payment',
query: {
type: 'add'
}

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

@ -1,40 +1,24 @@
<template>
<div class="common-list-contain">
<div class="common-form">
<van-form ref="form" :show-error-message="false" validate-trigger="" :submit-on-enter="false">
<div class="section"> <span class="line"> </span> 审批内容</div>
<van-form ref="form" :show-error-message="false" validate-trigger="" :submit-on-enter="false" label-width="8rem">
<div class="section"> <span class="line"> </span> 基本信息</div>
<div class="trips-box">
<div class="item-box">
<van-field v-model="form.contractNumber" @blur="handleCtBlur" placeholder="请输入" :disabled="['edit','show'].includes(this.$route.query.type)" :rules="[{ required: true, message: '请输入' }]" required label="合同编号" clear-trigger="always" input-align="right" />
<van-field v-model="form.contractName" required placeholder="请输入" :disabled="disabled" :rules="[{ required: true, message: '请输入' }]" label="合同名称" clear-trigger="always" input-align="right" />
<!-- <van-field :value="form.time" label="合同起止时间" :disabled="disabled ||oaListIsDisabled " :class="disabled ? 'actived-disabled':''" placeholder="请选择" required :rules="[{ required: true, message: '请选择' }]" @click="handleDateShow(1)" :right-icon="form.time ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">-->
<!-- </van-field>-->
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" />
<RePick v-model="form.supplierId" :disabled="disabled ||oaListIsDisabled " titleKey="companyAme" idKey="id" label="供应商名称" name="supplierId" :list="supplierList" isRequrie isCell clearable />
<RePick v-model="form.departmentId" :disabled="disabled" label="签约部门" @change="handleChange" :name="`departmentId`" :list="userDeptTree" isRequrie isCascader isShowSearch title="签约部门" titleKey="name" isCell clearable />
<RePick v-model="form.signatoryId" :disabled="disabled" titleKey="nickname" idKey="id" label="签约人员" name="signatoryId" :list="signatoryList" isRequrie isCell clearable />
<RePick v-model="form.contractType" :disabled="disabled" titleKey="contractName" idKey="id" label="合同类型" name="contractType" :list="typeList" isRequrie isCell clearable />
<RePick v-model="form.projectId" :disabled="disabled" titleKey="projectName" idKey="id" label="所属项目" name="contractType" :list="projectList" isRequrie isCell clearable />
<van-field v-model="form.amount" :disabled="disabled" type=" number" name="amount" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="合同总金额" />
<van-field label="是否收票" required name="isCollect" :disabled="disabled" input-align="right" :rules="[{ required:true, message: '请选择' }]" label-width="9em">
<template #input>
<van-radio-group :disabled="disabled" v-model="form.isCollect" direction="horizontal">
<van-radio :name="1"></van-radio>
<van-radio :name="0"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="form.managerPhone" :disabled="disabled" name="managerPhone" type="number" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '格式错误',validator: VerifyFunc.rePhone }]" label="经办人电话" />
<van-field v-model="form.dealContent" :disabled="disabled" name="reason" autosize rows="2" label="交易内容" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable />
<van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" />
<van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" />
<van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同简述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<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.receiptType" :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" :disabled="disabled" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '付款金额格式错误',validator: VerifyFunc.validatorMoney }]" label="付款金额" />
<RePick v-model="form.responsibleDeptId" @change="handleDept($event,1)" isRequrie :rules="[{ required: true, message: '请选择' }]" required :disabled="disabled" label="承担部门" name="responsibleDeptId" isShowSearch :list="userDeptTree" title="承担部门" titleKey="name" isCascader isCell clearable />
<RePick v-model="form.responsibleId" isRequrie :rules="[{ required: true, message: '请选择' }]" required :disabled="disabled" label="承担人" name="responsibleId" isShowSearch :list="userList" title="承担人" isCell titleKey="nickname" clearable />
<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 />
<van-field v-model="form.projectManager" required :rules="[{ required: true, message: '请输入' }]" :disabled="disabled" label="项目负责人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<van-field v-model="form.reason" laceholder="请输入" :disabled="disabled" autosize rows="1" type="textarea" :rules="[{ required: true, message: '请输入' }]" label="申请事由" required 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>
@ -43,299 +27,119 @@
<UploadFile :typeStr="typeStr" @onConfirm="handleUpload" :fileList="fileList" />
</div>
</div>
<div class="section mt5"> <span class="line"> </span>
<van-button type="info" size="small" :disabled="disabled || oaListIsDisabled" native-type="button" @click="handleAddPay" round>增加付款计划</van-button>
</div>
<div class="section mt5"> <span class="line"> </span>付款计划</div>
<div class="trips-box">
<div class="item-box" v-for="(item,index) in oaReimburseFeeitemList" :key="index">
<div class="oaList">
<div>
序号 {{index + 1}}
</div>
<div @click="handleDelOa(index)">
<van-icon name="delete-o" size="20" :color="`${disabled || oaListIsDisabled ? '#c8c9cc' : ''}`" />
</div>
</div>
<van-field v-model="item.planTime" label="计划付款时间" :disabled="disabled || oaListIsDisabled" :class="disabled ? 'actived-disabled':''" placeholder="请选择" @click="handlePDateShow(item.planTime,index)" :right-icon="item.planTime ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">
</van-field>
<van-field v-model="item.planName" label="计划名称" :disabled="disabled || oaListIsDisabled" name="planName" placeholder="请输入" input-align="right">
</van-field>
<van-field v-model="item.percentage" label="比例(数字)" :disabled="disabled || oaListIsDisabled" @blur="handleBulrPe($event,index)" name="percentage" type="number" placeholder="请输入" input-align="right">
</van-field>
<van-field v-model="item.actualAmount" name="actualAmount" :disabled="disabled || oaListIsDisabled" type="number" placeholder="请输入" input-align="right" label="实付金额" />
<van-field v-model="item.planMemo" label="备注" :disabled="disabled || oaListIsDisabled" name="planMemo" placeholder="请输入" input-align="right">
</van-field>
</div>
</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" />
</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" color="#0088FE" @confirm="handleDateSelect" />
<!--预计付款时间选择 -->
<van-calendar ref="pVanCalendar" allow-same-day :maxDate="maxDate" v-model="palnTimeShow" :min-date="minDate" :default-date="pDefaultDate" color="#0088FE" @confirm="handlePlanDateSelect" />
</div>
</template>
<script>
import dayjs from 'dayjs';
import { createSupplierContract, getSupplierContract } from '@/api/bs/supplierContract'
import { getSupplierCompanyPage } from "@/api/bs/quotationSheet";
import { listData } from "@/api/system/dict/data";
import { createVendorPayment, getVendorPayment, updateVendorPayment } from "@/api/bs/vendorPayment";
import VerifyFunc from '@/utils/verify'
import { getPaymentPlanPage } from "@/api/bs/paymentPlan";
import { Dialog } from 'vant'
import {
listUser,
} from "@/api/system/user";
import { getCustomerContractTypeListAll } from '@/api/bs/contractType'
import {getProjectPage} from "@/api/bs/project";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getVendorPage } from "@/api/bs/vendor";
import { getBankAccountInfoPage } from "@/api/bs/bankAccountInfo";
import { listUser } from "@/api/system/user";
export default {
//import使
name: 'contract-supplier',
props: {},
name: 'contract-payment',
components: {
UploadFile: () => import('@/components/UploadFile'),
RePick: () => import('@/components/ReComponents/RePick'),
ApprovalProcess: () => import('@/components/ApprovalProcess'),
BottomBtn: () => import('@/components/BottomBtn'),
},
//
computed: {
areaTree() {
return this.$store.getters.areaTree
},
userDeptTree() {
return this.$store.getters.userDeptTree
},
cn() {
return window.localStorage.getItem('cn')
},
userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
},
disabled() {
return ['show'].includes(this.$route.query.type)
},
ApprovalProcess: () => import('@/components/ApprovalProcess'),
RePick: () => import('@/components/ReComponents/RePick'),
UploadFile: () => import('@/components/UploadFile'),
},
// 访this
created() {
this.$loading(true)
this.handleInitList().then(() => {
this.$loading(false)
this.handleInitForm()
})
},
// 访DOM
mounted() {
},
data() {
return {
pIndex: 0,
pDefaultDate: new Date(),
palnTimeShow: false,
oaListIsDisabled: false,
isSave: false,
isRereset: false,
VerifyFunc,
typeList: [],
capitalSource:[],
projectList:[],
signatoryList: [],
departmentList: [],
dayjs,
supplierList: [],
accessId: null,
userList: [],
form: {},
allBankList: [],
allGysList: [],
isAuthorised: false,
accessId: null,
VerifyFunc,
isAuthority: 0,
typeStr: null, // show: edit: :
fileList: [],
btnList: [],
index: 0,
minDate: new Date('2000/01/01'),
maxDate: new Date('2030/01/01'),
defaultDate: new Date(),
dateShow: false,
form: {
time: null,
supplierId: null,
contractNumber: null,
contractName: null,
contractType: null,
amount: null,
isCollect: null,
managerPhone: null,
receivedAmount: null,
dealContent: null,
other: null,
},
oaReimburseFeeitemList: [],
dateType:''
btnList: [
{ title: '暂存', icon: 'star-o', color: "#909399", key: 0 },
{ title: '提交', icon: 'edit', color: "#ff9900", key: 1 },
{ title: '同意', icon: 'certificate', color: "#19be6b", key: 2 },
{ title: '驳回', icon: 'exchange', color: "#fa3534", key: 3 },
],
};
},
// data
watch: {},
//
methods: {
handleDelOa(index) {
if (this.disabled || this.oaListIsDisabled) {
return
}
Dialog.confirm({
title: '提示',
message: '你确定要删除吗?',
}).then(() => {
this.oaReimburseFeeitemList.splice(index, 1)
})
//
// bs_fee_type
computed: {
accountList() {
return getDictDatas(DICT_TYPE.BS_BANK_TYPE) || []
},
handleBulrPe(e, index) {
let list = this.oaReimburseFeeitemList
if (this.form.amount) {
this.$set(list[index], 'actualAmount', (this.form.amount * (Number(e.target.value) / 100)).toFixed(2))
} else {
this.$fm('输入合同金额,自动计算实付金额!')
}
moneyList() {
return getDictDatas(DICT_TYPE.CURRENCY_TYPE) || []
},
handleAddPay() {
this.oaReimburseFeeitemList.push({
planTime: null,
percentage: undefined,
actualAmount: undefined
})
areaTree() {
return this.$store.getters.areaTree
},
handleResetForm() {
// this.form = {
// time: null,
// supplierId: null,
// contractNumber: this.form.contractNumber,
// contractName: null,
// contractType: null,
// amount: null,
// isCollect: null,
// managerPhone: null,
// receivedAmount: null,
// dealContent: null,
// other: null,
// }
this.oaReimburseFeeitemList = []
userDeptTree() {
return this.$store.getters.userDeptTree
},
handleInitOaReimburseFeeitemList(e) {
getPaymentPlanPage({
pageNo: 1,
pageSize: 10,
contractNumber: e
}).then((res) => {
if (res.data && res.data.list.length) {
const { paymentPlanDetailDOList } = res.data.list[0]
this.oaReimburseFeeitemList = (paymentPlanDetailDOList || []).map(item => {
return {
...item,
actualAmount: Math.floor(Number(item.actualAmount) * 100) / 100,
planTime: dayjs(item.planTime).format('YYYY-MM-DD')
}
})
} else {
this.oaReimburseFeeitemList = []
cn() {
return window.localStorage.getItem('cn')
},
userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
},
disabled() {
return ['show'].includes(this.$route.query.type)
}
})
},
handleCtBlur(e) {
return new Promise(resolve => {
if (e.target.value) {
this.$loading(false)
getPaymentPlanPage({
//
methods: {
/** 查询用户列表 */
getList(id) {
return new Promise((resolve) => {
let queryParams = {
pageNo: 1,
pageSize: 10,
contractNumber: e.target.value,
type: 1
}).then((res) => {
if (res.data && res.data.list.length) {
const { paymentPlanDetailDOList } = res.data.list[0]
this.oaReimburseFeeitemList = (paymentPlanDetailDOList || []).map(item => {
return {
...item,
actualAmount: Math.floor(Number(item.actualAmount) * 100) / 100,
planTime: dayjs(item.planTime).format('YYYY/MM/DD')
pageSize: 100,
username: undefined,
mobile: undefined,
status: undefined,
deptId: id,
createTime: []
}
listUser(queryParams).then(response => {
resolve(response.data && response.data.list || [])
})
if (this.oaReimburseFeeitemList.length) {
this.oaListIsDisabled = true
}
let obj = res.data && res.data.list.length ? res.data.list[0] : null
if (obj) {
const { startTime, endTime, supplierId, actualAmount, managerPhone } = obj
this.form = {
contractNumber: this.form.contractNumber,
contractName: null,
contractType: null,
isCollect: null,
receivedAmount: null,
dealContent: null,
other: null,
time: `${dayjs(startTime).format('YYYY-MM-DD')} ~ ${dayjs(endTime).format('YYYY-MM-DD')}`,
date: [startTime, endTime],
supplierId: Number(supplierId),
amount: actualAmount,
startTime,
endTime,
managerPhone
}
}
this.$loading(false)
} else {
// this.handleResetForm()
this.$loading(false)
this.oaListIsDisabled = false
}
resolve()
}).catch(() => {
this.$loading(false)
this.oaListIsDisabled = false
// this.handleResetForm()
resolve()
})
} else {
this.oaReimburseFeeitemList = []
this.oaListIsDisabled = false
// this.handleResetForm()
resolve()
}
})
},
handleChange(val, type) {
handleDept(val, type) {
if (val) {
listUser({
pageNo: 1,
pageSize: 100,
deptId: val,
}).then((ns) => {
this.signatoryList = ns.data && ns.data.list || []
this.signatoryList = this.signatoryList.map((item) => {
return {
...item,
nickname: `${item.nickname} ${item.userNumber ? `(${item.userNumber})` : ''}`
}
})
if (!type) {
this.$set(this.form, 'signatoryId', null)
this.getList(val).then((res) => {
this.userList = res || []
if (type) {
this.$set(this.form, 'responsibleId', null)
}
})
} else {
this.signatoryList = []
this.$set(this.form, 'signatoryId', null)
this.userList = []
this.$set(this.form, 'responsibleId', null)
}
},
handleClear() {
this.$set(this.form, 'time', null)
},
handleSetAccessId(id) {
this.accessId = id
handleUpload(list) {
this.fileList = list
},
handleBtConfirm(key) {
if (key == 2 || key == 3) {
@ -343,283 +147,92 @@ export default {
}
this.$nextTick(() => {
this.$refs.form.validate().then(() => {
if (this.oaReimburseFeeitemList.length) {
let list = this.oaReimburseFeeitemList
for (let i = 0; i < list.length; i++) {
if (!(list[i].planTime && list[i].percentage && list[i].actualAmount)) {
// this.$modal.msgWarning(``)
if (!list[i].planTime) {
return this.$fm('请选择预计付款时间!')
}
let numreg = /^[1-9]\d*$/
if (!list[i].percentage || (!(list[i].percentage && (numreg.test(list[i].percentage))))) {
return this.$fm('比例仅支持整数!')
}
if (!list[i].actualAmount || (!(Number(list[i].actualAmount) > 0))) {
return this.$fm('实付金额输入有误!')
}
}
}
}
// /
let newForm = {
// approvalBiddingIdList: this.form.supplierList.filter(item => item.isWin == 1).map(n => n.id),
...this.form,
id: this.form.id,
status: key,
files: this.fileList,
oaReimburseFeeitemList: (this.oaReimburseFeeitemList).map(item => {
return {
...item,
planTime: dayjs(item.planTime).valueOf()
}
})
vendorIds: [this.form.vendorIds],
status: key
}
this.$loading(true, 'form')
createSupplierContract(newForm).then((res) => {
let api = newForm.id ? updateVendorPayment : createVendorPayment
api(newForm).then(() => {
this.$loading(false, 'form')
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
if (['add'].includes(this.$route.query.type)) {
this.$EventBus.$emit('handleResetLive', 'contract-mySupplier')
//
if (!newForm.id) {
this.$EventBus.$emit('handleResetLive', 'contract-corporatePayment')
}
history.back()
}).catch(() => {
this.$loading(false, 'form')
})
// })
if (!this.oaReimburseFeeitemList.length) {
this.$loading(false, 'form')
return this.$fm('暂无付款计划,无法提交!')
}
}).catch((err) => {
this.$loading(false, 'form')
if (err && err.length > 0 && err[0].name) {
if (err[0].name === 'amount') {
this.$fm(err[0].message)
}
const fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
const fieldHeight = fieldElement && fieldElement.offsetHeight;
const fieldHeight = fieldElement.offsetHeight;
const scrollHeight = fieldHeight + 50; // 50px
this.$refs.form.scrollToField(err[0].name, scrollHeight);
}
if (err && err.length) {
if (err[0].name === "managerPhone") {
return this.$fm('经办人手机号码错误!')
}
}
})
})
},
handleSetAccessId(id) {
this.accessId = id
},
handleInitForm() {
const { id, type } = this.$route.query || {}
this.typeStr = type
if (id) {
this.typeStr = this.$route.query.type
//
this.$EventBus.$emit('handleAddLive', 'contract-payment')
if (this.$route.query.id) {
this.$loading(true, 'loadingSb')
getSupplierContract(id).then((res) => {
this.form = res.data || {};
let api = getVendorPayment
api(this.$route.query.id).then((res) => {
this.form = {
...this.form,
time: `${dayjs(this.form.startTime).format('YYYY-MM-DD')} ~ ${dayjs(this.form.endTime).format('YYYY-MM-DD')}`,
departmentId: Number(this.form.departmentId),
signatoryId: Number(this.form.signatoryId),
isCollect: Number(this.form.isCollect),
...(res.data || {}),
responsibleId: res.data.responsibleId ? Number(res.data.responsibleId) : null,
vendorIds: Array.isArray(res.data.vendorIds) && res.data.vendorIds.length ? Number(res.data.vendorIds[0]) : null
}
this.handleChange(this.form.departmentId, 1)
// this.handleCtBlur({
// target: {
// value: res.data.contractNumber
// }
// })
// this.handleInitOaReimburseFeeitemList(res.data.contractNumber)
this.oaReimburseFeeitemList = this.form.oaReimburseFeeitemList || []
this.oaReimburseFeeitemList = this.oaReimburseFeeitemList.map((item) => {
return {
...item,
planTime: dayjs(item.planTime).format('YYYY/MM/DD')
if (this.form.responsibleDeptId) {
this.handleDept(this.form.responsibleDeptId)
}
})
this.fileList = res.data.files || []
this.isAuthorised = res.data.isAuthorised
this.$nextTick(() => {
this.$refs.BottomBtn.handleFilterBtnList()
})
console.log('this.form..', this.form);
}).finally(() => {
this.$loading(false, 'loadingSb')
})
}
},
handleUpload(list) {
this.fileList = list
},
handleNewConfirmPo(arr, index) {
let nameArr = []
this.userList.forEach(element => {
if (arr.includes(element.id)) {
nameArr.push(element.nickname)
}
});
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', arr)
this.$set(this.form.expenseApplyTrips[index], 'tripPartnersName', nameArr.join('、'))
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
},
handleConfirmPo(arr, index) {
let nameArr = this.form.expenseApplyTrips[index].tripPartnersName && this.form.expenseApplyTrips[index].tripPartnersName.split('、') || []
let newArr = this.form.expenseApplyTrips[index].tripPartners || []
this.userList.forEach(element => {
if (arr.includes(element.id)) {
nameArr.push(element.nickname)
newArr.push(element.id)
}
});
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', newArr)
this.$set(this.form.expenseApplyTrips[index], 'tripPartnersName', nameArr.join('、'))
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
},
handlePoShow(index) {
if (this.disabled) return
if (this.form.expenseApplyTrips[index].tripPartners.length) {
this.$set(this.form.expenseApplyTrips[index], 'type', 0)
this.$set(this.form.expenseApplyTrips[index], 'isOpen', true)
} else {
this.$fm('请先添加同行人!')
}
},
handlePoCancel(index) {
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
},
handleAddPeo(index) {
this.$set(this.form.expenseApplyTrips[index], 'isOpen', true)
this.$set(this.form.expenseApplyTrips[index], 'type', 1)
},
handleDel(index) {
this.form.expenseApplyTrips.splice(index, 1)
},
handleAdd() {
this.form.expenseApplyTrips.push({
time: null,
startTime: null,
endTime: null,
departureLocation: null,
departureLocationName: '',
destinationLocation: null,
destinationLocationName: '',
tripDay: undefined,
tripType: null,
tripPartners: [], //
tripPartnersName: "",
amount: undefined,
isOpen: false,
type: 0,
})
},
handleInitList() {
this.$loading(true, 'demo1')
return new Promise((resolve) => {
getSupplierCompanyPage({
pageNo: 1,
pageSize: 1000,
}).then((res) => {
this.supplierList = res.data.list || []
Promise.all([
getVendorPage({ pageNo: 1, pageSize: 999 }),
]).then(responses => {
//
this.allGysList = (responses[0].data.list || []).map(item => {
return {
id: item.id,
title: item.vendorName
}
});
this.$loading(false, 'demo1')
resolve()
})
getCustomerContractTypeListAll({
type: 2
}).then((res) => {
this.typeList = res.data || []
})
getProjectPage({type:2,pageNo: 1,
pageSize: 500}).then(res=>{
this.projectList = res.data.list || []
})
listData({
pageNo: 1,
pageSize: 50,
dictType: "capital_source",
}).then((res) => {
this.capitalSource = res.data.list || [];
}).catch(error => {
//
console.error('Error:', error);
});
})
},
handleDateShow(dateType) {
if (this.disabled) return
this.dateType = dateType
this.$nextTick(() => {
let date = dateType == 'dateSigning'?this.form.dateSigning:dateType=='proposerTime'?this.form.proposerTime:dateType=='startTime'?this.form.startTime:dateType=='endTime'?this.form.endTime:''
this.$refs.vanCalendar && this.$refs.vanCalendar.reset()
this.dateShow = true
if (date) {
let time = dayjs(Number(date)).format('YYYY/MM/DD');
this.defaultDate = new Date(time)
}
})
},
handlePDateShow(time, index) {
if (this.disabled) return
this.$nextTick(() => {
this.$refs.pVanCalendar && this.$refs.pVanCalendar.reset()
this.palnTimeShow = true
this.pIndex = index
if (time) {
this.pDefaultDate = dayjs(time).toDate()
}
})
},
handleDateSelect(val) {
if(this.dateType == 'dateSigning'){
this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`)
}
if(this.dateType == 'proposerTime'){
this.$set(this.form, 'proposerTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'proposerTime', `${dayjs(val).valueOf()}`)
}
if(this.dateType == 'startTime'){
this.$set(this.form, 'startTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'startTime', `${dayjs(val).valueOf()}`)
}
if(this.dateType == 'endTime'){
this.$set(this.form, 'endTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'endTime', `${dayjs(val).valueOf()}`)
}
// if (list && list.length) {
// this.$set(this.form, 'time', `${dayjs(list[0]).format('YY/MM/DD')}~${dayjs(list[1]).format('YY/MM/DD')}`)
// this.$set(this.form, 'startTime', dayjs(list[0]).valueOf())
// this.$set(this.form, 'endTime', dayjs(list[1]).valueOf())
// } else {
// this.$set(this.form, 'time', null)
// this.$set(this.form, 'startTime', null)
// this.$set(this.form, 'endTime', null)
// }
this.dateShow = false
},
handlePlanDateSelect(date) {
if (date) {
let num = this.oaReimburseFeeitemList.length - 1
let nextTime = (this.oaReimburseFeeitemList[this.pIndex + 1] || {}).planTime
let beforeTime = (this.oaReimburseFeeitemList[this.pIndex - 1] || {}).planTime
if (this.pIndex == 0 && nextTime) {
if (!(dayjs(nextTime).isAfter(date))) {
this.$set(this.oaReimburseFeeitemList[this.pIndex], 'planTime', null)
return this.$fm('当前预计付款时间必须在下一笔付款时间之前!')
}
} else if (num == this.pIndex && beforeTime || beforeTime) {
if (!(dayjs(date).isAfter(beforeTime))) {
this.$set(this.oaReimburseFeeitemList[this.pIndex], 'planTime', null)
return this.$fm('当前预计付款时间必须在上一笔付款时间之后!')
}
} else {
if (beforeTime && nextTime) {
if (!((dayjs(date).isAfter(beforeTime)) && (dayjs(nextTime).isAfter(date)))) {
this.$set(this.oaReimburseFeeitemList[this.pIndex], 'planTime', null)
return this.$fm('当前预计付款时间必须在上一笔和下一笔付款时间之间!')
}
}
}
this.$set(this.oaReimburseFeeitemList[this.pIndex], 'planTime', dayjs(date).format('YYYY/MM/DD'))
} else {
this.$set(this.oaReimburseFeeitemList[this.pIndex], 'planTime', null)
}
this.palnTimeShow = false
},
},
}
</script>

@ -13,10 +13,10 @@
<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" :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" />
<van-field v-model="form.projectManager" :disabled="disabled" label="项目负责人" :rules="[{ required: true, message: '请输入' }]" required 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.reason" laceholder="请输入" :disabled="disabled" autosize rows="1" type="textarea" :rules="[{ required: true, message: '请输入' }]" label="申请事由" required 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>
@ -142,7 +142,9 @@ export default {
}).catch((err) => {
this.$loading(false, 'form')
if (err && err.length > 0 && err[0].name) {
if (err[0].name === 'amount') {
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

Loading…
Cancel
Save