[update] - 确认来款功能的添加
This commit is contained in:
@@ -116,6 +116,14 @@ const incomingUpdatePayment = (param) => postAction('/member/tbMemberProjectSubi
|
|||||||
// 更新会员系统 证书缴费的发票信息
|
// 更新会员系统 证书缴费的发票信息
|
||||||
const incomingUpdateCertificate = (param) => postAction('/member/tbCertificatePayment/incomingUpdateCertificate', param)
|
const incomingUpdateCertificate = (param) => postAction('/member/tbCertificatePayment/incomingUpdateCertificate', param)
|
||||||
|
|
||||||
|
|
||||||
|
// 确认来款- 查询当前项目是否有来款信息
|
||||||
|
const getPayConfirmList = (param) => getAction('/payConfirmPaymentRecord/list', param)
|
||||||
|
// 新增一个确认来款信息
|
||||||
|
const addPayConfirm = (param) => postAction('/payConfirmPaymentRecord/add', param)
|
||||||
|
// 编辑一个确认来款信息
|
||||||
|
const editPayConfirm = (param) => postAction('/payConfirmPaymentRecord/edit', param)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getWorkingGroupById,
|
getWorkingGroupById,
|
||||||
getChargeNotice,
|
getChargeNotice,
|
||||||
@@ -174,5 +182,10 @@ export {
|
|||||||
judgeInternalEnterprise,
|
judgeInternalEnterprise,
|
||||||
|
|
||||||
incomingUpdatePayment,
|
incomingUpdatePayment,
|
||||||
incomingUpdateCertificate
|
incomingUpdateCertificate,
|
||||||
|
|
||||||
|
|
||||||
|
getPayConfirmList,
|
||||||
|
addPayConfirm,
|
||||||
|
editPayConfirm
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,11 @@
|
|||||||
:disabled="record.projectType === 3 && record.registerCheckResult === '0'">来款</a>
|
:disabled="record.projectType === 3 && record.registerCheckResult === '0'">来款</a>
|
||||||
<a @click="invoicing(record)" :disabled="record.needInvoice === 0"
|
<a @click="invoicing(record)" :disabled="record.needInvoice === 0"
|
||||||
v-has="'incomePaymentAndInvoiving:invoicing'">开票</a>
|
v-has="'incomePaymentAndInvoiving:invoicing'">开票</a>
|
||||||
|
<!-- 确认来款项目--- 普通项目、工作组项目、资料网员 项目 可以确认来款-->
|
||||||
|
<a
|
||||||
|
v-show="record.projectType === ProjectTypeEnums.GENERAL_PRO.value || record.projectType === ProjectTypeEnums.GROUP_PRO.value || record.projectType === ProjectTypeEnums.MEMBER_PRO.value"
|
||||||
|
@click="preComeMoney(record)"
|
||||||
|
>确认来款</a>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -181,7 +186,8 @@
|
|||||||
<audit-proof-module ref="auditProof" @ok="modalFormOk"></audit-proof-module>
|
<audit-proof-module ref="auditProof" @ok="modalFormOk"></audit-proof-module>
|
||||||
<!-- 会议审核的弹窗 -->
|
<!-- 会议审核的弹窗 -->
|
||||||
<audit-modal ref="auditModal" :meeting-type="meetingType" :situation-id="situationId" @ok="modalFormOk"></audit-modal>
|
<audit-modal ref="auditModal" :meeting-type="meetingType" :situation-id="situationId" @ok="modalFormOk"></audit-modal>
|
||||||
|
<!-- 确认来款 弹窗-->
|
||||||
|
<pre-come-module ref="preComeModule" @ok="modalFormOk"></pre-come-module>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -200,6 +206,18 @@ import { isAllEqual } from '../../../utils/util'
|
|||||||
import AuditProofModule from './modules/AuditProofModule'
|
import AuditProofModule from './modules/AuditProofModule'
|
||||||
// import AuditProofModule from "@views/financialManagement/arriveAndInvoicing/modules/AuditProofModule";
|
// import AuditProofModule from "@views/financialManagement/arriveAndInvoicing/modules/AuditProofModule";
|
||||||
import AuditModal from '@views/incomePayments/meetManage/modules/AuditModal'
|
import AuditModal from '@views/incomePayments/meetManage/modules/AuditModal'
|
||||||
|
import PreComeModule from './modules/PreComeModule'
|
||||||
|
|
||||||
|
// 项目类型 数据字典 的定义 和数据库的保持一致
|
||||||
|
const ProjectTypeEnums = {
|
||||||
|
GENERAL_PRO: {name: '普通项目', value: 1},
|
||||||
|
GROUP_PRO: {name: '工作组项目', value: 2},
|
||||||
|
MEETING_PRO: {name: '会议项目', value: 3},
|
||||||
|
MEMBER_PRO: {name: '会员项目', value: 4},
|
||||||
|
STANDARD_MEMBER_PRO: {name: '标协会员项目', value: 5},
|
||||||
|
STANDARD_CERTIFICATE_PRO: {name: '标协证书项目', value: 6},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ArriveAndInvoivingList',
|
name: 'ArriveAndInvoivingList',
|
||||||
@@ -213,12 +231,14 @@ export default {
|
|||||||
ProjectDetailModal,
|
ProjectDetailModal,
|
||||||
BatchInvoicingModule,
|
BatchInvoicingModule,
|
||||||
AuditProofModule,
|
AuditProofModule,
|
||||||
AuditModal
|
AuditModal,
|
||||||
|
PreComeModule
|
||||||
},
|
},
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
IconImg,
|
IconImg,
|
||||||
|
ProjectTypeEnums,
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 }
|
sm: { span: 5 }
|
||||||
@@ -320,7 +340,7 @@ export default {
|
|||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 160,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -465,6 +485,17 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 确认来款 - 普通项目、工作组项目、资料网员 项目 可以确认来款(即记录跨年度提前来款)
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
preComeMoney(record) {
|
||||||
|
// 判断是否是 普通项目、工作组项目、资料网员 项目 不是 直接返回
|
||||||
|
let canOpe = record.projectType === ProjectTypeEnums.GENERAL_PRO.value || record.projectType === ProjectTypeEnums.GROUP_PRO.value || record.projectType === ProjectTypeEnums.MEMBER_PRO.value
|
||||||
|
if(!canOpe) return
|
||||||
|
this.$refs.preComeModule.show(record)
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 搜索金额校验
|
* 搜索金额校验
|
||||||
* @param type 起始范围--start,终止范围--end
|
* @param type 起始范围--start,终止范围--end
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
<!--提前来款页面 ---即确认来款 模态框 -->
|
||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
okText="保存"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-form-item label="到账金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入到账金额"
|
||||||
|
v-decorator="['amountReceived',validatorRules.amountReceived]"
|
||||||
|
:maxLength='50'
|
||||||
|
@blur="addZero"
|
||||||
|
@change="e => e.target.value = (e.target.value.replace(/[^0-9-.]/g, '')).trim()"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="到账日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-date placeholder="请选择到账日期"
|
||||||
|
style="width: 100%;"
|
||||||
|
v-decorator="['paymentDate',validatorRules.paymentDate]"
|
||||||
|
:trigger-change="true"
|
||||||
|
date-format="YYYY-MM-DD"/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入备注"
|
||||||
|
v-decorator="['remark']"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import {money} from '../../../../utils/validate'
|
||||||
|
import JDate from '../../../../components/tools/JDate'
|
||||||
|
// import { addPaymentPhase, editAmountPhase } from '../../../../api/incomePaymentsApi'
|
||||||
|
import {addZero} from '../../../../utils/util'
|
||||||
|
import { getPayConfirmList, addPayConfirm, editPayConfirm } from '../../../../api/incomePaymentsApi'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PreComeModule',
|
||||||
|
components: {JDate},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '到账信息',
|
||||||
|
width: 600,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
isEdit: false,
|
||||||
|
labelCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 5}
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 18}
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
amountReceived: {
|
||||||
|
rules: [{required: true, validator: this.checkMoney}],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
paymentDate: {
|
||||||
|
rules: [{required: true, message: '请选择到账日期'}],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addZero,
|
||||||
|
show(record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.projectInfo = Object.assign({}, record)
|
||||||
|
// 通过record 的id 去获取当前项目的确认来款数据
|
||||||
|
this.getInfoById(record.id)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'paymentDate', 'remark'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'paymentDate', 'remark'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getInfoById(id) {
|
||||||
|
getPayConfirmList({projectId: id}).then(res => {
|
||||||
|
if(res.success) {
|
||||||
|
this.isEdit = (res.result || []).length === 1
|
||||||
|
if(this.isEdit) {
|
||||||
|
this.edit(res.result[0])
|
||||||
|
} else {
|
||||||
|
this.edit({})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isEdit = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
values.projectId = this.projectInfo.id
|
||||||
|
values.projectType = this.projectInfo.projectType
|
||||||
|
const obj = Object.assign(this.model, values)
|
||||||
|
let okHttpMethod
|
||||||
|
if (this.isEdit) {
|
||||||
|
okHttpMethod = editPayConfirm(obj)
|
||||||
|
} else {
|
||||||
|
okHttpMethod = addPayConfirm(obj)
|
||||||
|
}
|
||||||
|
okHttpMethod.then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验金额格式
|
||||||
|
* @param rules
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
checkMoney(rules, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
if (money(value)) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||||
|
}
|
||||||
|
callback('请输入到账金额')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user