|
|
@ -1,40 +1,24 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="common-list-contain">
|
|
|
|
<div class="common-list-contain">
|
|
|
|
<div class="common-form">
|
|
|
|
<div class="common-form">
|
|
|
|
<van-form ref="form" :show-error-message="false" validate-trigger="" :submit-on-enter="false">
|
|
|
|
<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="section"> <span class="line"> </span> 基本信息</div>
|
|
|
|
<div class="trips-box">
|
|
|
|
<div class="trips-box">
|
|
|
|
<div class="item-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.vendorReceiptNo" v-if="form.vendorReceiptNo" disabled 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 v-model="cn" disabled 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 v-model="form.projectName" :disabled="disabled" label="项目名称" clear-trigger="always" placeholder="请输入" input-align="right" />
|
|
|
|
<!-- </van-field>-->
|
|
|
|
<van-field v-model="userInfo.nickname" disabled label="申请人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
|
|
|
|
<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 v-model="userInfo.dept.name" disabled label="申请部门" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
|
|
|
|
<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.receiptType" :disabled="disabled" label="付款类型" name="accountType" :list="accountList" title="账户类型" titleKey="label" idKey="value" isCell clearable />
|
|
|
|
<RePick v-model="form.supplierId" :disabled="disabled ||oaListIsDisabled " titleKey="companyAme" idKey="id" label="供应商名称" name="supplierId" :list="supplierList" isRequrie isCell clearable />
|
|
|
|
<RePick v-model="form.currency" :disabled="disabled" label="付款币种" name="currency" :list="moneyList" title="收取币种" titleKey="label" idKey="value" isCell clearable />
|
|
|
|
<RePick v-model="form.departmentId" :disabled="disabled" label="签约部门" @change="handleChange" :name="`departmentId`" :list="userDeptTree" isRequrie isCascader isShowSearch title="签约部门" titleKey="name" 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.signatoryId" :disabled="disabled" titleKey="nickname" idKey="id" label="签约人员" name="signatoryId" :list="signatoryList" isRequrie isCell clearable />
|
|
|
|
<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.contractType" :disabled="disabled" titleKey="contractName" idKey="id" label="合同类型" name="contractType" :list="typeList" isRequrie 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.projectId" :disabled="disabled" titleKey="projectName" idKey="id" label="所属项目" name="contractType" :list="projectList" isRequrie isCell 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.amount" :disabled="disabled" type=" number" name="amount" placeholder="请输入" input-align="right" required :rules="[{ required: true, message: '格式错误',validator: VerifyFunc.validatorMoney }]" label="合同总金额" />
|
|
|
|
<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 label="是否收票" required name="isCollect" :disabled="disabled" input-align="right" :rules="[{ required:true, message: '请选择' }]" label-width="9em">
|
|
|
|
<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" />
|
|
|
|
<template #input>
|
|
|
|
<van-field v-model="form.remark" placeholder="请输入" :disabled="disabled" autosize rows="1" type="textarea" label="备注信息" clear-trigger="always" input-align="right" />
|
|
|
|
<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" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section mt5"> <span class="line"> </span>附件</div>
|
|
|
|
<div class="section mt5"> <span class="line"> </span>附件</div>
|
|
|
@ -43,299 +27,119 @@
|
|
|
|
<UploadFile :typeStr="typeStr" @onConfirm="handleUpload" :fileList="fileList" />
|
|
|
|
<UploadFile :typeStr="typeStr" @onConfirm="handleUpload" :fileList="fileList" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</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>
|
|
|
|
<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" />
|
|
|
|
<ApprovalProcess v-if="['show'].includes(typeStr)" :processInstanceId="form.processInstanceId" @onSetId="handleSetAccessId" />
|
|
|
|
</van-form>
|
|
|
|
</van-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<BottomBtn ref="BottomBtn" :isAuthorised="isAuthorised" @onBtConfirm="handleBtConfirm" :accessId="accessId" />
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import { createVendorPayment, getVendorPayment, updateVendorPayment } from "@/api/bs/vendorPayment";
|
|
|
|
import { createSupplierContract, getSupplierContract } from '@/api/bs/supplierContract'
|
|
|
|
|
|
|
|
import { getSupplierCompanyPage } from "@/api/bs/quotationSheet";
|
|
|
|
|
|
|
|
import { listData } from "@/api/system/dict/data";
|
|
|
|
|
|
|
|
import VerifyFunc from '@/utils/verify'
|
|
|
|
import VerifyFunc from '@/utils/verify'
|
|
|
|
import { getPaymentPlanPage } from "@/api/bs/paymentPlan";
|
|
|
|
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
|
|
|
|
import { Dialog } from 'vant'
|
|
|
|
import { getVendorPage } from "@/api/bs/vendor";
|
|
|
|
import {
|
|
|
|
import { getBankAccountInfoPage } from "@/api/bs/bankAccountInfo";
|
|
|
|
listUser,
|
|
|
|
import { listUser } from "@/api/system/user";
|
|
|
|
} from "@/api/system/user";
|
|
|
|
|
|
|
|
import { getCustomerContractTypeListAll } from '@/api/bs/contractType'
|
|
|
|
|
|
|
|
import {getProjectPage} from "@/api/bs/project";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
//import引入组件才能使用
|
|
|
|
//import引入组件才能使用
|
|
|
|
name: 'contract-supplier',
|
|
|
|
|
|
|
|
props: {},
|
|
|
|
props: {},
|
|
|
|
|
|
|
|
name: 'contract-payment',
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
UploadFile: () => import('@/components/UploadFile'),
|
|
|
|
|
|
|
|
RePick: () => import('@/components/ReComponents/RePick'),
|
|
|
|
|
|
|
|
ApprovalProcess: () => import('@/components/ApprovalProcess'),
|
|
|
|
|
|
|
|
BottomBtn: () => import('@/components/BottomBtn'),
|
|
|
|
BottomBtn: () => import('@/components/BottomBtn'),
|
|
|
|
},
|
|
|
|
ApprovalProcess: () => import('@/components/ApprovalProcess'),
|
|
|
|
// 计算属性
|
|
|
|
RePick: () => import('@/components/ReComponents/RePick'),
|
|
|
|
computed: {
|
|
|
|
UploadFile: () => import('@/components/UploadFile'),
|
|
|
|
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)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 生命周期,创建完成时(可以访问当前this实例)
|
|
|
|
// 生命周期,创建完成时(可以访问当前this实例)
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.$loading(true)
|
|
|
|
|
|
|
|
this.handleInitList().then(() => {
|
|
|
|
this.handleInitList().then(() => {
|
|
|
|
this.$loading(false)
|
|
|
|
|
|
|
|
this.handleInitForm()
|
|
|
|
this.handleInitForm()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 生命周期:挂载完成时(可以访问DOM元素)
|
|
|
|
// 生命周期:挂载完成时(可以访问DOM元素)
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
pIndex: 0,
|
|
|
|
userList: [],
|
|
|
|
pDefaultDate: new Date(),
|
|
|
|
form: {},
|
|
|
|
palnTimeShow: false,
|
|
|
|
allBankList: [],
|
|
|
|
oaListIsDisabled: false,
|
|
|
|
allGysList: [],
|
|
|
|
isSave: false,
|
|
|
|
|
|
|
|
isRereset: false,
|
|
|
|
|
|
|
|
VerifyFunc,
|
|
|
|
|
|
|
|
typeList: [],
|
|
|
|
|
|
|
|
capitalSource:[],
|
|
|
|
|
|
|
|
projectList:[],
|
|
|
|
|
|
|
|
signatoryList: [],
|
|
|
|
|
|
|
|
departmentList: [],
|
|
|
|
|
|
|
|
dayjs,
|
|
|
|
|
|
|
|
supplierList: [],
|
|
|
|
|
|
|
|
accessId: null,
|
|
|
|
|
|
|
|
isAuthorised: false,
|
|
|
|
isAuthorised: false,
|
|
|
|
|
|
|
|
accessId: null,
|
|
|
|
|
|
|
|
VerifyFunc,
|
|
|
|
|
|
|
|
isAuthority: 0,
|
|
|
|
typeStr: null, // show: 查看 edit: 编辑: 其他新增
|
|
|
|
typeStr: null, // show: 查看 edit: 编辑: 其他新增
|
|
|
|
fileList: [],
|
|
|
|
fileList: [],
|
|
|
|
btnList: [],
|
|
|
|
btnList: [
|
|
|
|
index: 0,
|
|
|
|
{ title: '暂存', icon: 'star-o', color: "#909399", key: 0 },
|
|
|
|
minDate: new Date('2000/01/01'),
|
|
|
|
{ title: '提交', icon: 'edit', color: "#ff9900", key: 1 },
|
|
|
|
maxDate: new Date('2030/01/01'),
|
|
|
|
{ title: '同意', icon: 'certificate', color: "#19be6b", key: 2 },
|
|
|
|
defaultDate: new Date(),
|
|
|
|
{ title: '驳回', icon: 'exchange', color: "#fa3534", key: 3 },
|
|
|
|
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:''
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 计算属性
|
|
|
|
// 监听data中的数据变化
|
|
|
|
// bs_fee_type
|
|
|
|
watch: {},
|
|
|
|
computed: {
|
|
|
|
// 方法集合
|
|
|
|
accountList() {
|
|
|
|
methods: {
|
|
|
|
return getDictDatas(DICT_TYPE.BS_BANK_TYPE) || []
|
|
|
|
handleDelOa(index) {
|
|
|
|
|
|
|
|
if (this.disabled || this.oaListIsDisabled) {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Dialog.confirm({
|
|
|
|
|
|
|
|
title: '提示',
|
|
|
|
|
|
|
|
message: '你确定要删除吗?',
|
|
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
this.oaReimburseFeeitemList.splice(index, 1)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleBulrPe(e, index) {
|
|
|
|
moneyList() {
|
|
|
|
let list = this.oaReimburseFeeitemList
|
|
|
|
return getDictDatas(DICT_TYPE.CURRENCY_TYPE) || []
|
|
|
|
if (this.form.amount) {
|
|
|
|
|
|
|
|
this.$set(list[index], 'actualAmount', (this.form.amount * (Number(e.target.value) / 100)).toFixed(2))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$fm('输入合同金额,自动计算实付金额!')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleAddPay() {
|
|
|
|
areaTree() {
|
|
|
|
this.oaReimburseFeeitemList.push({
|
|
|
|
return this.$store.getters.areaTree
|
|
|
|
planTime: null,
|
|
|
|
|
|
|
|
percentage: undefined,
|
|
|
|
|
|
|
|
actualAmount: undefined
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleResetForm() {
|
|
|
|
userDeptTree() {
|
|
|
|
// this.form = {
|
|
|
|
return this.$store.getters.userDeptTree
|
|
|
|
// 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 = []
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleInitOaReimburseFeeitemList(e) {
|
|
|
|
cn() {
|
|
|
|
getPaymentPlanPage({
|
|
|
|
return window.localStorage.getItem('cn')
|
|
|
|
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 = []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleCtBlur(e) {
|
|
|
|
userInfo() {
|
|
|
|
return new Promise(resolve => {
|
|
|
|
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
|
|
|
|
if (e.target.value) {
|
|
|
|
},
|
|
|
|
this.$loading(false)
|
|
|
|
disabled() {
|
|
|
|
getPaymentPlanPage({
|
|
|
|
return ['show'].includes(this.$route.query.type)
|
|
|
|
pageNo: 1,
|
|
|
|
}
|
|
|
|
pageSize: 10,
|
|
|
|
},
|
|
|
|
contractNumber: e.target.value,
|
|
|
|
// 方法集合
|
|
|
|
type: 1
|
|
|
|
methods: {
|
|
|
|
}).then((res) => {
|
|
|
|
/** 查询用户列表 */
|
|
|
|
if (res.data && res.data.list.length) {
|
|
|
|
getList(id) {
|
|
|
|
const { paymentPlanDetailDOList } = res.data.list[0]
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
this.oaReimburseFeeitemList = (paymentPlanDetailDOList || []).map(item => {
|
|
|
|
let queryParams = {
|
|
|
|
return {
|
|
|
|
pageNo: 1,
|
|
|
|
...item,
|
|
|
|
pageSize: 100,
|
|
|
|
actualAmount: Math.floor(Number(item.actualAmount) * 100) / 100,
|
|
|
|
username: undefined,
|
|
|
|
planTime: dayjs(item.planTime).format('YYYY/MM/DD')
|
|
|
|
mobile: undefined,
|
|
|
|
}
|
|
|
|
status: undefined,
|
|
|
|
})
|
|
|
|
deptId: id,
|
|
|
|
if (this.oaReimburseFeeitemList.length) {
|
|
|
|
createTime: []
|
|
|
|
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()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
listUser(queryParams).then(response => {
|
|
|
|
|
|
|
|
resolve(response.data && response.data.list || [])
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleChange(val, type) {
|
|
|
|
handleDept(val, type) {
|
|
|
|
if (val) {
|
|
|
|
if (val) {
|
|
|
|
listUser({
|
|
|
|
this.getList(val).then((res) => {
|
|
|
|
pageNo: 1,
|
|
|
|
this.userList = res || []
|
|
|
|
pageSize: 100,
|
|
|
|
if (type) {
|
|
|
|
deptId: val,
|
|
|
|
this.$set(this.form, 'responsibleId', null)
|
|
|
|
}).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)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.signatoryList = []
|
|
|
|
this.userList = []
|
|
|
|
this.$set(this.form, 'signatoryId', null)
|
|
|
|
this.$set(this.form, 'responsibleId', null)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleClear() {
|
|
|
|
handleUpload(list) {
|
|
|
|
this.$set(this.form, 'time', null)
|
|
|
|
this.fileList = list
|
|
|
|
},
|
|
|
|
|
|
|
|
handleSetAccessId(id) {
|
|
|
|
|
|
|
|
this.accessId = id
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleBtConfirm(key) {
|
|
|
|
handleBtConfirm(key) {
|
|
|
|
if (key == 2 || key == 3) {
|
|
|
|
if (key == 2 || key == 3) {
|
|
|
@ -343,283 +147,92 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.form.validate().then(() => {
|
|
|
|
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 = {
|
|
|
|
let newForm = {
|
|
|
|
// approvalBiddingIdList: this.form.supplierList.filter(item => item.isWin == 1).map(n => n.id),
|
|
|
|
|
|
|
|
...this.form,
|
|
|
|
...this.form,
|
|
|
|
id: this.form.id,
|
|
|
|
|
|
|
|
status: key,
|
|
|
|
|
|
|
|
files: this.fileList,
|
|
|
|
files: this.fileList,
|
|
|
|
oaReimburseFeeitemList: (this.oaReimburseFeeitemList).map(item => {
|
|
|
|
vendorIds: [this.form.vendorIds],
|
|
|
|
return {
|
|
|
|
status: key
|
|
|
|
...item,
|
|
|
|
|
|
|
|
planTime: dayjs(item.planTime).valueOf()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
createSupplierContract(newForm).then((res) => {
|
|
|
|
let api = newForm.id ? updateVendorPayment : createVendorPayment
|
|
|
|
|
|
|
|
api(newForm).then(() => {
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
|
|
|
|
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()
|
|
|
|
history.back()
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
|
|
|
|
if (!this.oaReimburseFeeitemList.length) {
|
|
|
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
|
|
|
return this.$fm('暂无付款计划,无法提交!')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
if (err && err.length > 0 && err[0].name) {
|
|
|
|
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 fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
|
|
|
|
const fieldHeight = fieldElement && fieldElement.offsetHeight;
|
|
|
|
const fieldHeight = fieldElement.offsetHeight;
|
|
|
|
const scrollHeight = fieldHeight + 50; // 假设添加了 50px 的额外高度
|
|
|
|
const scrollHeight = fieldHeight + 50; // 假设添加了 50px 的额外高度
|
|
|
|
this.$refs.form.scrollToField(err[0].name, scrollHeight);
|
|
|
|
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() {
|
|
|
|
handleInitForm() {
|
|
|
|
const { id, type } = this.$route.query || {}
|
|
|
|
this.typeStr = this.$route.query.type
|
|
|
|
this.typeStr = type
|
|
|
|
// 注入缓存
|
|
|
|
if (id) {
|
|
|
|
this.$EventBus.$emit('handleAddLive', 'contract-payment')
|
|
|
|
|
|
|
|
if (this.$route.query.id) {
|
|
|
|
this.$loading(true, 'loadingSb')
|
|
|
|
this.$loading(true, 'loadingSb')
|
|
|
|
getSupplierContract(id).then((res) => {
|
|
|
|
let api = getVendorPayment
|
|
|
|
this.form = res.data || {};
|
|
|
|
api(this.$route.query.id).then((res) => {
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
|
...this.form,
|
|
|
|
...(res.data || {}),
|
|
|
|
time: `${dayjs(this.form.startTime).format('YYYY-MM-DD')} ~ ${dayjs(this.form.endTime).format('YYYY-MM-DD')}`,
|
|
|
|
responsibleId: res.data.responsibleId ? Number(res.data.responsibleId) : null,
|
|
|
|
departmentId: Number(this.form.departmentId),
|
|
|
|
vendorIds: Array.isArray(res.data.vendorIds) && res.data.vendorIds.length ? Number(res.data.vendorIds[0]) : null
|
|
|
|
signatoryId: Number(this.form.signatoryId),
|
|
|
|
}
|
|
|
|
isCollect: Number(this.form.isCollect),
|
|
|
|
if (this.form.responsibleDeptId) {
|
|
|
|
|
|
|
|
this.handleDept(this.form.responsibleDeptId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.fileList = res.data.files || []
|
|
|
|
this.fileList = res.data.files || []
|
|
|
|
this.isAuthorised = res.data.isAuthorised
|
|
|
|
this.isAuthorised = res.data.isAuthorised
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.BottomBtn.handleFilterBtnList()
|
|
|
|
this.$refs.BottomBtn.handleFilterBtnList()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log('this.form..', this.form);
|
|
|
|
|
|
|
|
}).finally(() => {
|
|
|
|
}).finally(() => {
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
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() {
|
|
|
|
handleInitList() {
|
|
|
|
|
|
|
|
this.$loading(true, 'demo1')
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
getSupplierCompanyPage({
|
|
|
|
Promise.all([
|
|
|
|
pageNo: 1,
|
|
|
|
getVendorPage({ pageNo: 1, pageSize: 999 }),
|
|
|
|
pageSize: 1000,
|
|
|
|
]).then(responses => {
|
|
|
|
}).then((res) => {
|
|
|
|
// 处理每个请求的结果
|
|
|
|
this.supplierList = res.data.list || []
|
|
|
|
this.allGysList = (responses[0].data.list || []).map(item => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
id: item.id,
|
|
|
|
|
|
|
|
title: item.vendorName
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.$loading(false, 'demo1')
|
|
|
|
resolve()
|
|
|
|
resolve()
|
|
|
|
})
|
|
|
|
}).catch(error => {
|
|
|
|
getCustomerContractTypeListAll({
|
|
|
|
// 处理错误情况
|
|
|
|
type: 2
|
|
|
|
console.error('Error:', error);
|
|
|
|
}).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 || [];
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
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>
|
|
|
|
</script>
|
|
|
|