Merge branch 'master' into change0706

This commit is contained in:
lijiarao
2022-08-11 09:29:54 +08:00
11 changed files with 845 additions and 109 deletions
+18 -3
View File
@@ -58,7 +58,7 @@ export default {
required: false
},
// 当前需要转换key的属性, 悬浮显示实际具体内容信息时需要
// paymentRecord 来款 mail -- 邮寄 bill--开票
// paymentRecord 来款 confirm-确认收入 mail -- 邮寄 bill--开票
statusKey: {
type: String,
required: false,
@@ -106,6 +106,9 @@ export default {
} else {
return finished
}
} else if(this.statusNo === 4) {
// 确认收入莫名其妙的出现了 4, 所以修改成 全部确认的样式
return finished
}
}
},
@@ -129,9 +132,16 @@ export default {
// 到账、开票、邮寄 的时候,请求接口获得相应的数据
// 判断条件 tooltip显示、 有不同的统计状态,统计状态值不为0 没有请求过详情数据
if (visible && this.statusType && this.statusNo && !this.hasInfo) {
this.getInfoFunc({ id: this.statuObj.id }).then(res => {
let idKey = this.statusKey === 'confirm' && 'projectId' || 'id'
this.getInfoFunc({ [idKey]: this.statuObj.id }).then(res => {
if (res.success) {
let arr = res.result[this.opeStatusKey] || []
let arr = []
if(this.statusKey === 'confirm') {
// 确认收入单独的实现逻辑
arr = res.result || []
} else {
arr = res.result[this.opeStatusKey] || []
}
let result = []
arr.map(tt => {
result.push(this.showTemplate(tt))
@@ -139,6 +149,7 @@ export default {
// 对tooltip中的文字进行替换
this.currentTitle = result.join('\n')
this.hasInfo = true
}
})
}
@@ -165,6 +176,10 @@ export default {
if (item.sendDate || item.postNo) {
result = `${ item.sendDate }新增邮寄信息,邮寄单号:${ item.postNo }`
}
} else if (this.statusKey === 'confirm') {
if (item.paymentDate || item.amountReceived) {
result = `${ item.paymentDate }确认收入${ item.amountReceived }`
}
}
return result
}
@@ -51,12 +51,14 @@
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="缴费凭证状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam.paymentStatus" placeholder="请选择缴费凭证状态" dictCode="payment_status"/>
<j-dict-select-tag v-model="queryParam.paymentStatus" placeholder="请选择缴费凭证状态"
dictCode="payment_status"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="来款开票状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam.paidInvoicStatus" placeholder="请选择来款开票状态" dictCode="paid_invoic_status"/>
<j-dict-select-tag v-model="queryParam.paidInvoicStatus" placeholder="请选择来款开票状态"
dictCode="paid_invoic_status"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -117,6 +119,11 @@
<status-slot :statu-obj="record" :status-no="text" :status-type="true"></status-slot>
</template>
<!-- 确认收入 -->
<template slot="status-confirm" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="confirm" :get-info-func="getPayConfirmList"></status-slot>
</template>
<!-- 开票-->
<template slot="status-bill" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="bill"></status-slot>
@@ -133,9 +140,10 @@
<span slot="action" class="action-span-cell" slot-scope="text, record">
<!-- 待审核状态显示审核按钮-->
<!--会议项目待审核状态 待上传也显示审核 -->
<a @click="auditProof(record)"
class="audit-btn"
v-if="record.checkPaymentStatus === 'toBeReviewed'"
v-if="record.checkPaymentStatus === 'toBeReviewed' || (record.projectType === 3 && record.paymentStatus === 'toBeUploaded') "
v-has="'incomePaymentAndInvoiving:audit'">审核</a>
<!-- 未审核通过的会议项目不允许在这里来款-->
<a @click="incomePayment(record)"
@@ -143,11 +151,8 @@
:disabled="record.projectType === 3 && record.registerCheckResult === '0'">来款</a>
<a @click="invoicing(record)" :disabled="record.needInvoice === 0"
v-has="'incomePaymentAndInvoiving:invoicing'">开票</a>
<!-- 确认收入项目--- 普通项目工作组项目资料网员 项目 可以确认收入-->
<a
v-has="'incomePaymentAndInvoiving:confirmPayment'"
@click="preComeMoney(record)"
>确认收入</a>
<!-- 确认收入项目--- 普通项目工作组项目资料网员 项目 可以确认收入 报名状态是 待审核的时候 不能确认收入-->
<a v-has="'incomePaymentAndInvoiving:confirmPayment'" @click="confirmPayment(record)">确认收入</a>
</span>
</a-table>
</div>
@@ -158,6 +163,7 @@
@ok="modalFormOk"
:project-id="selectProjectId"
:project-type="selectProjectType"
:need-invoice="selectNeedInvoice"
:visible.sync="arriveVisible"></arrive-stage-module>
<!-- 开票阶段-->
@@ -185,16 +191,23 @@
<!-- 审核缴费凭证-->
<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>
<confirm-stage-module
ref="confirmStageModule"
@ok="modalFormOk"
:project-id="selectProjectId"
:project-type="selectProjectType"
:visible.sync="confirmStageVisible"
></confirm-stage-module>
</div>
</template>
<script>
import PageHeaderTitle from '../../../components/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/icon_financial.png'
import { JeroListMixin } from '../../../mixins/JeroListMixin'
import {JeroListMixin} from '../../../mixins/JeroListMixin'
import JYearDate from '../../../components/jero/JYearDate'
import StatusSlot from '../../../components/tools/StatusSlot'
import ArriveStageModule from './modules/ArriveStageModule'
@@ -202,11 +215,12 @@ import InvoicingStageModule from './modules/InvoicingStageModule'
import SelectPrincipal from '../../../components/company/SelectPrincipal'
import ProjectDetailModal from '../../../components/ProjectDetailModal'
import BatchInvoicingModule from '../../packManagement/modules/BatchInvoicingModule'
import { isAllEqual } from '../../../utils/util'
import {isAllEqual} from '../../../utils/util'
import AuditProofModule from './modules/AuditProofModule'
// import AuditProofModule from "@views/financialManagement/arriveAndInvoicing/modules/AuditProofModule";
import AuditModal from '@views/incomePayments/meetManage/modules/AuditModal'
import PreComeModule from './modules/PreComeModule'
import ConfirmStageModule from './modules/ConfirmStageModule'
import {getPayConfirmList} from '../../../api/incomePaymentsApi'
// 项目类型 数据字典 的定义 和数据库的保持一致
const ProjectTypeEnums = {
@@ -232,7 +246,7 @@ export default {
BatchInvoicingModule,
AuditProofModule,
AuditModal,
PreComeModule
ConfirmStageModule
},
mixins: [JeroListMixin],
data() {
@@ -240,12 +254,12 @@ export default {
IconImg,
ProjectTypeEnums,
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 10 }
xs: {span: 24},
sm: {span: 10}
},
columns: [
{
@@ -262,86 +276,92 @@ export default {
align: 'center',
width: 280,
dataIndex: 'chargeProject',
scopedSlots: { customRender: 'projectName' }
scopedSlots: {customRender: 'projectName'}
}, {
title: '来款用途',
align: 'center',
width: 180,
dataIndex: 'chargeUse_dictText',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
}, {
title: '项目负责人',
align: 'center',
width: 140,
dataIndex: 'principalName',
scopedSlots: { customRender: 'contact' }
scopedSlots: {customRender: 'contact'}
}, {
title: '来款单位',
align: 'center',
width: 280,
dataIndex: 'chargeCompanyTemporaryName',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
}, {
title: '企业联系人',
align: 'center',
width: 140,
dataIndex: 'contactsTemporaryName',
scopedSlots: { customRender: 'contact' }
scopedSlots: {customRender: 'contact'}
}, {
title: '应收金额',
align: 'center',
width: 100,
dataIndex: 'receivableAmount',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
}, {
title: '实收金额',
align: 'center',
width: 100,
dataIndex: 'paidAmount',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
}, {
title: '缴费凭证状态',
align: 'center',
width: 120,
dataIndex: 'paymentStatus_dictText',
scopedSlots: { customRender: 'text' }
scopedSlots: {customRender: 'text'}
}, {
title: '打包',
align: 'center',
width: 70,
dataIndex: 'pack',
scopedSlots: { customRender: 'status-pack' }
scopedSlots: {customRender: 'status-pack'}
}, {
title: '需要发票',
align: 'center',
width: 80,
dataIndex: 'needInvoice',
scopedSlots: { customRender: 'status-pack' }
scopedSlots: {customRender: 'status-pack'}
}, {
title: '到账',
align: 'center',
width: 70,
dataIndex: 'inAccount',
scopedSlots: { customRender: 'status' }
scopedSlots: {customRender: 'status'}
}, {
title: '收入',
align: 'center',
width: 70,
dataIndex: 'affirmIncome',
scopedSlots: {customRender: 'status-confirm'}
}, {
title: '开票',
align: 'center',
width: 70,
dataIndex: 'makeInvoice',
scopedSlots: { customRender: 'status-bill' }
scopedSlots: {customRender: 'status-bill'}
}, {
title: '邮寄',
align: 'center',
width: 70,
dataIndex: 'mail',
scopedSlots: { customRender: 'status-mail' }
scopedSlots: {customRender: 'status-mail'}
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 250,
scopedSlots: { customRender: 'action' }
scopedSlots: {customRender: 'action'}
}
],
url: {
@@ -351,11 +371,13 @@ export default {
selectProjectId: null, // 选中项目id
selectProjectType: null, // 选中项目类型
selectProjectName: null, // 选中项目名称open
selectNeedInvoice: null, // 选中项目是否需要发票
selectProjectChargeCompanyName: null, // 选中项目来款企业
invoicingVisible: false,
arriveVisible: false,
selectedProject: [],
batchInvoicingVisible: false,
confirmStageVisible: false, // 确认收入弹框是否隐藏
selectedCompany: {}, // 选中项目的企业信息
mailContactsId: null,// 项目邮寄联系人id
meetingType: undefined, // 会议项目的会议类型
@@ -364,6 +386,7 @@ export default {
}
},
methods: {
getPayConfirmList,
/**
* 来款
* @param record
@@ -371,6 +394,7 @@ export default {
incomePayment(record) {
this.selectProjectType = record.projectType
this.selectProjectId = record.id
this.selectNeedInvoice = record.needInvoice
this.arriveVisible = true
},
/**
@@ -380,7 +404,7 @@ export default {
invoicing(record) {
// 标协会员项目必须先到账后开票
if ((Number(record.projectType) === 5 || Number(record.projectType) === 6) && record.paymentStatus !== 'completed') {
this.$message.warn(`标协${ Number(record.projectType) === 5 ? '会员' : '证书' }项目必须先审核通过才可开票。`)
this.$message.warn(`标协${Number(record.projectType) === 5 ? '会员' : '证书'}项目必须先审核通过才可开票。`)
return
}
this.mailContactsId = record.mailContactsId
@@ -480,8 +504,13 @@ export default {
if (record.projectType === 3) {
this.meetingType = record.meetingType
this.situationId = record.situationId
let params = {
meetingType:record.meetingType,
situationId:record.situationId,
type:'kp'
}
this.$refs.auditModal.title = '审核凭证'
this.$refs.auditModal.open(record, false)
this.$refs.auditModal.open(params, false)
return
}
},
@@ -489,11 +518,14 @@ export default {
* 确认收入 - 普通项目、工作组项目、资料网员 项目 可以确认收入(即记录跨年度提前来款)
* @param record
*/
preComeMoney(record) {
confirmPayment(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)
this.selectProjectType = record.projectType
this.selectProjectId = record.id
this.confirmStageVisible = true
this.$refs.confirmStageModule.show(record)
},
/**
@@ -15,7 +15,21 @@
<a-input placeholder="请输入到账金额"
v-decorator="['amountReceived',validatorRules.amountReceived]"
:maxLength='50'
@blur="addZero"
@blur="addZeroAmount"
@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">
<a-input placeholder="请输入税额"
v-decorator="['tax',validatorRules.tax]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'noTaxAmount', 'amountReceived')"
@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">
<a-input placeholder="请输入未税金额"
v-decorator="['noTaxAmount',validatorRules.noTaxAmount]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'tax', 'amountReceived')"
@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">
@@ -40,14 +54,15 @@
<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 { TaxOperateMixin } from './TaxOperateMixin'
export default {
name: 'ArriveModule',
components: { JDate },
mixins: [TaxOperateMixin],
props: {
// 项目id
projectId: {
@@ -61,6 +76,18 @@ export default {
required: false,
default: null
},
// 项目是否需要发票
needInvoice: {
type: [Number, String],
required: false,
default: null
},
},
watch: {
// 监听是否需要发票 然后修改响应的税率值
needInvoice(value) {
this.taxRate = value ? 0.06 : 0
}
},
data() {
return {
@@ -83,6 +110,14 @@ export default {
rules: [{ required: true, validator: this.checkMoney }],
validateTrigger: 'blur'
},
noTaxAmount: {
rules: [{required: true, validator: this.checkNoTaxMoney}],
validateTrigger: 'blur'
},
tax: {
rules: [{required: true, validator: this.checkTaxMoney}],
validateTrigger: 'blur'
},
paymentDate: {
rules: [{ required: true, message: '请选择来款日期' }],
validateTrigger: 'change'
@@ -100,7 +135,7 @@ export default {
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'paymentDate', 'remark'))
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax', 'noTaxAmount', 'paymentDate', 'remark'))
})
},
handleOk() {
@@ -145,21 +180,16 @@ export default {
close() {
this.visible = false
},
/**
* 校验金额格式
* @param rules
* @param value
* @param callback
*/
// 校验金额格式
checkMoney(rules, value, callback) {
if (value) {
if (money(value)) {
callback()
}
callback('请输入合法的金额数字,最多2位小数,10位整数')
}
callback('请输入到账金额')
}
this.checkMoneyTemplate(rules, value, callback, '到账金额')
},
checkNoTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '未税金额')
},
checkTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '税额')
},
}
}
</script>
@@ -16,7 +16,21 @@
<a-input placeholder="请输入确认金额"
v-decorator="['amountReceived',validatorRules.amountReceived]"
:maxLength='50'
@blur="addZero"
@blur="addZeroAmount"
@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">
<a-input placeholder="请输入税额"
v-decorator="['tax',validatorRules.tax]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'noTaxAmount', 'amountReceived')"
@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">
<a-input placeholder="请输入未税金额"
v-decorator="['noTaxAmount',validatorRules.noTaxAmount]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'tax', 'amountReceived')"
@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">
@@ -41,15 +55,30 @@
<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'
import { TaxOperateMixin } from './TaxOperateMixin'
export default {
name: 'PreComeModule',
name: 'ConfirmModule',
components: {JDate},
mixins: [TaxOperateMixin],
props:{
// id
projectId: {
type: String,
required: false,
default: null
},
//
projectType: {
type: [Number, String],
required: false,
default: null
},
},
data() {
return {
title: '确认信息',
@@ -72,6 +101,14 @@ export default {
rules: [{required: true, validator: this.checkMoney}],
validateTrigger: 'blur'
},
noTaxAmount: {
rules: [{required: true, validator: this.checkNoTaxMoney}],
validateTrigger: 'blur'
},
tax: {
rules: [{required: true, validator: this.checkTaxMoney}],
validateTrigger: 'blur'
},
paymentDate: {
rules: [{required: true, message: '请选择确认日期'}],
validateTrigger: 'change'
@@ -81,6 +118,29 @@ export default {
},
methods: {
addZero,
add(projectInfo, isFirst) {
let currentDate = new Date()
let paymentDate = currentDate.getFullYear() + '-' + (currentDate.getMonth() + 1) + '-' + currentDate.getDate()
let record = { paymentDate }
//
if(isFirst && projectInfo.invoiceAmount) {
//
record.amountReceived = projectInfo.invoiceAmount
let obj = this.calcOtherNumber(record.amountReceived)
record = {...record, ...obj}
}
this.edit(record, projectInfo)
},
// edit(record) {
// this.form.resetFields()
// this.model = Object.assign({}, record)
// this.getMailContactPostalCode()
// this.visible = true
// this.$nextTick(() => {
// this.form.setFieldsValue(pick(this.model, 'invoiceAmount', 'billNo', 'billDate', 'remark'))
// })
// },
show(record) {
this.form.resetFields()
this.projectInfo = Object.assign({}, record)
@@ -88,10 +148,15 @@ export default {
this.getInfoById(record.id)
this.visible = true
},
edit(record) {
edit(record, projectInfo) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.projectInfo = Object.assign({}, projectInfo)
//
this.taxRate = this.projectInfo.needInvoice ? 0.06 : 0
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'paymentDate', 'remark'))
this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax', 'noTaxAmount','paymentDate', 'remark'))
})
},
getInfoById(id) {
@@ -123,7 +188,7 @@ export default {
values.projectType = this.projectInfo.projectType
const obj = Object.assign(this.model, values)
let okHttpMethod
if (this.isEdit) {
if (this.model.id) {
okHttpMethod = editPayConfirm(obj)
} else {
okHttpMethod = addPayConfirm(obj)
@@ -154,19 +219,17 @@ export default {
},
/**
* 校验金额格式
* @param rules
* @param value
* @param callback
*/
checkMoney(rules, value, callback) {
if (value) {
if (money(value)) {
callback()
}
callback('请输入合法的金额数字,最多2位小数,10位整数')
}
callback('请输入确认金额')
}
this.checkMoneyTemplate(rules, value, callback, '确认金额')
},
checkNoTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '未税金额')
},
checkTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '税额')
},
}
}
</script>
@@ -0,0 +1,250 @@
<!--确认来款的阶段 模态框-->
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleAdd"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<template v-if="stageList.length > 0">
<div v-for="(item, index) in stageList" :key="index" class="stage-box">
<div class="title">
<div class="title-text">{{ item.chinaNumIndex }}阶段</div>
<img src="../../../../assets/imgs/icon/icon_edit.png" @click="handleEdit(item)">
</div>
<a-row>
<a-col :span="6">
<div class="stage">
<div class="stage-title">确认金额</div>
<div class="stage-content">{{ item.amountReceived }}</div>
</div>
</a-col>
<a-col :span="6">
<div class="stage">
<div class="stage-title">税额</div>
<div class="stage-content stage-content-money">{{ item.tax }}</div>
</div>
</a-col>
<a-col :span="6">
<div class="stage">
<div class="stage-title">未税金额</div>
<div class="stage-content">{{ item.noTaxAmount }}</div>
</div>
</a-col>
<a-col :span="6">
<div class="stage">
<div class="stage-title">确认日期</div>
<div class="stage-content">{{ item.paymentDate }}</div>
</div>
</a-col>
</a-row>
<a-row>
<a-col>
<div class="stage">
<div class="stage-title">备注</div>
<div class="stage-content">{{ item.remark }}</div>
</div>
</a-col>
</a-row>
</div>
</template>
<a-empty v-else></a-empty>
</a-spin>
<template slot="footer">
<a-button type="primary" @click="handleAdd" v-preventclick>添加阶段</a-button>
</template>
<confirm-module
ref="confirmModal"
:project-id="projectId"
v-bind="$attrs"
@ok="loadData"></confirm-module>
</j-modal>
</template>
<script>
import ConfirmModule from './ConfirmModule'
import {getPayConfirmList, payBillList} from '../../../../api/incomePaymentsApi'
export default {
name: 'InvoicingStageModule',
components: { ConfirmModule },
provide: {},
props: {
// 项目id
projectId: {
type: String,
required: false,
default: null
},
// 弹窗显隐
visible: {
type: Boolean,
required: false,
default: false
}
},
data() {
return {
title: '确认收入阶段',
width: 900,
// visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
// 阶段列表,用于循环展示阶段信息
stageList: []
}
},
watch: {
// 弹窗显示时获取数据
visible: {
handler(value) {
if (value) {
this.open()
}
}
}
},
methods: {
// 显示数据的相关方法
show(record) {
console.log(record)
// 存储项目的信息
this.projectInfo = record
},
handleAdd() {
this.$refs.confirmModal.title = '添加阶段'
this.$refs.confirmModal.add(this.projectInfo, this.stageList.length === 0)
},
handleEdit(record) {
this.$refs.confirmModal.title = '编辑阶段'
this.$refs.confirmModal.edit(record, this.projectInfo)
},
handleCancel() {
this.close()
},
open() {
// this.visible = true
console.log(this.projectId, "________projectId________")
this.loadData()
},
close() {
// this.visible = false
this.$emit('update:visible', false)
this.$emit('ok')
},
loadData() {
this.confirmLoading = true
getPayConfirmList({projectId: this.projectId}).then(res => {
this.stageList = res.result || []
// 匹配每一项的汉字序号
this.stageList.forEach((item, index) => {
item.chinaNumIndex = this.convertToChinaNum(index + 1)
})
}).finally(() => {
this.$forceUpdate()
this.confirmLoading = false
})
},
//将数字(整数)转为汉字
convertToChinaNum(num) {
let arr1 = new Array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九')
let arr2 = new Array('', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万', '十', '百', '千', '亿')//可继续追加更高位转换值
if (!num || isNaN(num)) {
return '零'
}
let english = num.toString().split('')
let result = ''
for (let i = 0; i < english.length; i++) {
let des_i = english.length - 1 - i//倒序排列设值
result = arr2[i] + result
let arr1_index = english[des_i]
result = arr1[arr1_index] + result
}
//将【零千、零百】换成【零】 【十零】换成【十】
result = result.replace(/零(千|百|十)/g, '零').replace(/十零/g, '十')
//合并中间多个零为一个零
result = result.replace(/零+/g, '零')
//将【零亿】换成【亿】【零万】换成【万】
result = result.replace(/零亿/g, '亿').replace(/零万/g, '万')
//将【亿万】换成【亿】
result = result.replace(/亿万/g, '亿')
//移除末尾的零
result = result.replace(/零+$/, '')
//将【零一十】换成【零十】
//result = result.replace(/零一十/g, '零十');//貌似正规读法是零一十
//将【一十】换成【十】
result = result.replace(/^一十/g, '十')
return result
}
}
}
</script>
<style scoped lang="less">
.stage-box {
padding-bottom: 10px;
}
.title {
display: flex;
align-items: center;
padding-bottom: 10px;
&-text {
position: relative;
font-size: 16px;
font-family: NotoSansHans, NotoSansHans-DemiLight;
font-weight: 700;
color: #333333;
margin-right: 10px;
}
&-text::before {
position: absolute;
top: 4px;
left: -10px;
content: "";
height: 20px;
width: 2px;
background: #069f99;
}
img {
height: 13px;
cursor: pointer;
}
}
.stage {
display: flex;
padding-bottom: 10px;
&-title {
flex-shrink: 0;
text-align: right;
font-size: 14px;
font-family: NotoSansHans, NotoSansHans-Light;
color: #4D4D4D;
}
&-content {
padding-right: 20px;
word-break: break-all;
white-space: pre-wrap;
font-size: 14px;
font-family: NotoSansHans, NotoSansHans-Light;
color: #4D4D4D;
&-money {
color: #D40505;
white-space: pre-wrap;
}
}
}
</style>
@@ -15,7 +15,21 @@
<a-input placeholder="请输入开票金额"
v-decorator="['invoiceAmount',validatorRules.invoiceAmount]"
:maxLength='50'
@blur="addZero"
@blur="addZeroAmount"
@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">
<a-input placeholder="请输入税额"
v-decorator="['tax',validatorRules.tax]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'noTaxAmount', 'invoiceAmount')"
@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">
<a-input placeholder="请输入未税金额"
v-decorator="['noTaxAmount',validatorRules.noTaxAmount]"
:maxLength='50'
@blur="(e) => addZeroTaxOrNo(e, 'tax', 'invoiceAmount')"
@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">
@@ -47,14 +61,15 @@
<script>
import JDate from '../../../../components/tools/JDate'
import pick from 'lodash.pick'
import { money } from '../../../../utils/validate'
import { addPayBill, editPayBill } from '../../../../api/incomePaymentsApi'
import { addZero } from '../../../../utils/util'
import { getContactsById } from '../../../../api/api'
import {TaxOperateMixin} from './TaxOperateMixin'
export default {
name: 'InvoicingModule',
components: { JDate },
mixins: [TaxOperateMixin],
props: {
// 项目id
projectId: {
@@ -85,7 +100,7 @@ export default {
type: String,
required: false,
default: null
},
}
},
data() {
return {
@@ -108,6 +123,14 @@ export default {
rules: [{ required: true, validator: this.checkMoney }],
validateTrigger: 'blur'
},
noTaxAmount: {
rules: [{required: true, validator: this.checkNoTaxMoney}],
validateTrigger: 'blur'
},
tax: {
rules: [{required: true, validator: this.checkTaxMoney}],
validateTrigger: 'blur'
},
billNo: {
rules: [{ required: true, message: '请输入开票号' }],
validateTrigger: 'blur'
@@ -132,7 +155,7 @@ export default {
this.getMailContactPostalCode()
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'invoiceAmount', 'billNo', 'billDate', 'remark'))
this.form.setFieldsValue(pick(this.model, 'invoiceAmount', 'tax', 'noTaxAmount', 'billNo', 'billDate', 'remark'))
})
},
getMailContactPostalCode() {
@@ -164,6 +187,8 @@ export default {
let bmpList = [
{
invoiceAmount: formData.invoiceAmount,
tax: formData.tax,
noTaxAmount: formData.noTaxAmount,
projectId: this.projectId,
projectType: this.projectType,
remark: formData.remark
@@ -172,6 +197,8 @@ export default {
addData.bmpList = bmpList
delete addData.projectName
delete addData.remark
delete addData.tax
delete addData.noTaxAmount
okHttpMethod = addPayBill(addData)
}
okHttpMethod.then(res => {
@@ -198,20 +225,16 @@ export default {
close() {
this.visible = false
},
/**
* 校验金额格式
* @param rules
* @param value
* @param callback
*/
// 校验金额格式
checkMoney(rules, value, callback) {
if (value) {
if (money(value)) {
callback()
}
callback('请输入合法的金额数字,最多2位小数,10位整数')
}
callback('请输入到账金额')
this.checkMoneyTemplate(rules, value, callback, '开票金额')
},
checkNoTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '未税金额')
},
checkTaxMoney(rules, value, callback) {
this.checkMoneyTemplate(rules, value, callback, '税额')
}
}
}
@@ -0,0 +1,68 @@
/*换入税率操作的相关方法*/
import {money} from '../../../../utils/validate'
export const TaxOperateMixin = {
data() {
return {
taxRate: 0.06, // 税率
}
},
methods: {
/**
* 校验金额格式
* @param rules
* @param value
* @param callback
* @param name --校验字段的名字
*
*/
checkMoneyTemplate(rules, value, callback, name) {
if (value) {
if (money(value)) {
callback()
}
callback('请输入合法的金额数字,最多2位小数,10位整数')
}
callback(`请输入${name}`)
},
// 总金额做相关的处理
addZeroAmount(event) {
this.addZero(event)
let finalValue = event.target.value
// 计算未税金额和税额的值
let obj = this.calcOtherNumber(finalValue)
// console.log(event.target.value )
this.$nextTick(() => {
this.form.setFieldsValue(obj)
})
},
/**
* 税额\未税金额 失去焦点的事件
* @param event --失去焦点的event ,存储当前input 的值
* @param keyName -- 想互斥 数字 对应的key值
* @param amountKeyName--当前dom 中 存储金额的字段的key值
*
*/
addZeroTaxOrNo(event, keyName, amountKeyName) {
console.log('-----addZeroTaxOrNo---', event.target.value)
this.addZero(event)
let amount = this.form.getFieldValue(amountKeyName)
if(!amount) return
let finalValue = event.target.value
let otherVlaue = (amount - finalValue).toFixed(2)
this.$nextTick(() => {
this.form.setFieldsValue({[keyName]: otherVlaue})
})
},
// 通过金额 计算 税额、未税金额
calcOtherNumber(amount) {
let noTaxAmount = (amount / (1 + this.taxRate)).toFixed(2) // 未税金额
let tax = (amount - noTaxAmount).toFixed(2) // 税额
return {noTaxAmount, tax}
},
}
}
@@ -223,22 +223,37 @@ export default {
signUpPersonId: '',
}
},
watch:{
situationId(val){
this.signUpPersonId = val
this.querySingUpUserInfo()
return val
}
},
methods: {
open(record, signUp) {
this.form.resetFields()
this.visible = true
this.signUpPersonId = this.situationId ? this.situationId : record.id
this.querySingUpUserInfo()
// 控制行程信息显示 审核凭证不显示
this.checkSignBool = signUp || false
let meetingType = this.meetingType ? this.meetingType+'' :this.$route.query.meetingType
// 到账开票
if(record.type && record.type === 'kp' ){
meetingType = record.meetingType + ''
this.signUpPersonId = record.situationId
this.querySingUpUserInfo()
}else {
this.querySingUpUserInfo()
}
// 会议类型不同 url不同
this.url = Object.assign({}, this.createUrlByMeetingType(meetingType))
console.log(record)
this.visible = true
},
close() {
this.$emit('close')
this.visible = false
this.model = {}
this.signUpPersonId = ''
},
handleOk() {
const that = this
@@ -111,7 +111,10 @@
<template slot="status" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true"></status-slot>
</template>
<!-- 确认收入 -->
<template slot="status-confirm" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="confirm" :get-info-func="getPayConfirmList"></status-slot>
</template>
<!-- 开票-->
<template slot="status-bill" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="bill"></status-slot>
@@ -132,6 +135,7 @@
<a @click="cancelPack(record.id)" v-has="'packProject:cancelPack'">取消打包</a>
<a @click="invoicing(record)" :disabled="record.needInvoice === 0 || Number(record.receivableAmount) === 0"
v-has="'packProject:invoicing'">开票</a>
<a v-has="'packProject:confirmPayment'" @click="confirmPayment(record)" :disabled="Number(record.receivableAmount) === 0">确认收入</a>
</span>
</a-table>
</div>
@@ -165,6 +169,7 @@
:project-type="selectProjectType"
:project-id="selectProjectId"
:visible.sync="arriveStageVisible"
:need-invoice="selectNeedInvoice"
@ok="modalFormOk"></arrive-stage-module>
<!-- 开票阶段-->
@@ -176,6 +181,14 @@
:project-type="selectProjectType"
:project-name="selectProjectName"
@ok="modalFormOk"></invoicing-stage-module>
<!-- 确认收入阶段 -->
<confirm-stage-module
ref="confirmStageModule"
:visible.sync="confirmStageVisible"
:project-id="selectProjectId"
:project-type="selectProjectType"
:project-name="selectProjectName"
@ok="modalFormOk"></confirm-stage-module>
<!-- 项目详情-->
<project-detail-modal ref="projectDetail"></project-detail-modal>
@@ -195,6 +208,8 @@ import ArriveStageModule from '../financialManagement/arriveAndInvoicing/modules
import InvoicingStageModule from '../financialManagement/arriveAndInvoicing/modules/InvoicingStageModule'
import { getPackCompanyById, batchRemovePackProject, removePackProject } from '../../api/incomePaymentsApi'
import ProjectDetailModal from '../../components/ProjectDetailModal'
import ConfirmStageModule from '../financialManagement/arriveAndInvoicing/modules/ConfirmStageModule'
import {getPayConfirmList} from '@/api/incomePaymentsApi'
export default {
name: 'PackProjectMaintenance',
@@ -207,7 +222,8 @@ export default {
BatchInvoicingModule,
ArriveStageModule,
InvoicingStageModule,
ProjectDetailModal
ProjectDetailModal,
ConfirmStageModule
},
mixins: [JeroListMixin],
data() {
@@ -304,6 +320,12 @@ export default {
width: 80,
dataIndex: 'inAccount',
scopedSlots: { customRender: 'status' }
}, {
title: '收入',
align: 'center',
width: 80,
dataIndex: 'affirmIncome',
scopedSlots: {customRender: 'status-confirm'}
}, {
title: '开票',
align: 'center',
@@ -339,7 +361,7 @@ export default {
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 180,
width: 280,
scopedSlots: { customRender: 'action' }
}
],
@@ -350,9 +372,11 @@ export default {
incomeVisible: false, // 批量来款对话框开启状态
arriveStageVisible: false, // 来款阶段对话框开启状态
invoicingStageVisible: false, // 开票阶段对话框开启状态
confirmStageVisible: false, // 确认收入阶段对话框开启状态
selectProjectId: null, // 选中项目id
selectProjectType: null, // 选中项目类型
selectProjectName: null, // 选中项目名称
selectNeedInvoice: null, // 选中项目是否需要发票
selectProjectChargeCompanyName: null, // 选中项目来款企业
url: {
list: '/pack/payPackCompanyProject/listAll',
@@ -367,6 +391,7 @@ export default {
})
},
methods: {
getPayConfirmList,
/**
* 获取企业信息
*/
@@ -503,6 +528,7 @@ export default {
incomePayment(record) {
this.selectProjectId = record.id
this.arriveStageVisible = true
this.selectNeedInvoice = record.needInvoice
this.selectProjectType = record.projectType
},
/**
@@ -559,7 +585,18 @@ export default {
}
resolve(arr)
})
}
},
/**
* 确认收入 -(记录跨年度提前来款)
* @param record
*/
confirmPayment(record) {
this.selectProjectType = record.projectType
this.selectProjectId = record.id
this.confirmStageVisible = true
this.$refs.confirmStageModule.show(record)
},
}
}
</script>
@@ -0,0 +1,203 @@
<!--全所收入的统计-->
<template>
<div class="whole-payments-statistics">
<page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false">
<!-- 查询区域-start -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="确认年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-year-date :allowClear="false" style="width:100%" placeholder="请选择确认年份" v-model="queryParam.paymentYear"></j-year-date>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" icon="search" @click="searchQuery"
v-has="'wholePaymentsStatistics:search'">查询</a-button>
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- /查询区域-end-->
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="export" @click="handleExportXls('全所收入统计')"
v-has="'wholePaymentsStatistics:export'">导出
</a-button>
</div>
<!-- 操作按钮区域-end-->
<!-- table表格区域-->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="projectId"
:columns="columns"
:scroll="{x: 1500}"
:dataSource="dataSource"
:pagination="false"
:loading="loading"
@change="handleTableChange"
class="j-table-force-nowrap main-table">
<template slot="text" slot-scope="text">
<a-tooltip>
<template slot="title">{{ text }}</template>
<div class="table-text">{{ text }}</div>
</a-tooltip>
</template>
<template slot="allMoney" slot-scope="text">
<a-tooltip>
<template slot="title">{{ formatMoney(text) }}</template>
<div class="table-text">{{ formatMoney(text) }}</div>
</a-tooltip>
</template>
</a-table>
</div>
</a-card>
</div>
</template>
<script>
import IconImg from '@/assets/imgs/icon/icon_statistical_report.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
import JYearDate from '../../components/jero/JYearDate'
import {JeroListMixin} from '../../mixins/JeroListMixin'
import {formatMoney} from '@/utils/formatMoney'
import {getAction} from '../../api/manage'
import { MonthData } from './statisticData'
// 对表头进行操作
const columns = [
{
title: '',
align: 'center',
width: 150,
dataIndex: 'indexName',
scopedSlots: {customRender: 'text'}
},
// {
// title: '1月',
// align: 'center',
// width: 150,
// dataIndex: 'allMoney',
// sorter: true,
// scopedSlots: {customRender: 'allMoney'}
// },
]
MonthData.map(tt => {
columns.push({
title: tt.name,
align: 'center',
width: 150,
dataIndex: tt.key,
// sorter: true,
scopedSlots: {customRender: 'allMoney'}
})
})
columns.push({
title: '总计',
align: 'center',
width: 150,
dataIndex: 'total',
fixed: 'right',
scopedSlots: {customRender: 'allMoney'}
})
export default {
name: 'WholePaymentsStatistics',
components: {PageHeaderTitle, JYearDate},
mixins: [JeroListMixin],
data() {
return {
IconImg,
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 10}
},
columns,
// 给定当年作为确认收入年份默认查询条件
queryParam: {
paymentYear: new Date().getFullYear().toString()
},
lastQueryParam: {
paymentYear: new Date().getFullYear().toString()
},
url: {
list: '/statistics/allProjectMoneyStatistics/list',
exportXlsUrl: '/statistics/allProjectMoneyStatistics/excel'
},
}
},
methods : {
formatMoney,
loadData(arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
let params = this.getQueryParams()//查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
let dataSource = res.result.list
// 讲树形结构的数据 ,修改成table可以直接展示的数据,默认只有三行数据
let tableData = [
{indexName: '确认收入金额', total: res.result.sumOfConfirmAmount},
{indexName: '开票金额', total: res.result.sumOfBillMoney},
{indexName: '到账金额', total: res.result.sumOfReallyMoney},
]
dataSource.map((item, index) => {
let keyItem = MonthData.find(ele => Number(ele.value) === (index + 1))
if(keyItem) {
let key = keyItem.key
tableData[0][key] = item.confirmAmount
tableData[1][key] = item.billMoney
tableData[2][key] = item.comeAllMoney
}
})
this.dataSource = tableData
}
if (res.code === 510) {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
searchReset() {
this.lastQueryParam = {
paymentYear: new Date().getFullYear().toString()
}
this.queryParam = {
paymentYear: new Date().getFullYear().toString()
}
this.exportSelectedKeys = []
this.loadData(1)
},
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
+12 -12
View File
@@ -1,14 +1,14 @@
export const MonthData = [
{name: '1月', value: '01'},
{name: '2月', value: '02'},
{name: '3月', value: '03'},
{name: '4月', value: '04'},
{name: '5月', value: '05'},
{name: '6月', value: '06'},
{name: '7月', value: '07'},
{name: '8月', value: '08'},
{name: '9月', value: '09'},
{name: '10月', value: '10'},
{name: '11月', value: '11'},
{name: '12月', value: '12'},
{name: '1月', value: '01', key: 'January'},
{name: '2月', value: '02', key: 'February'},
{name: '3月', value: '03', key: 'March'},
{name: '4月', value: '04', key: 'April'},
{name: '5月', value: '05', key: 'May'},
{name: '6月', value: '06', key: 'June'},
{name: '7月', value: '07', key: 'July'},
{name: '8月', value: '08', key: 'August'},
{name: '9月', value: '09', key: 'September'},
{name: '10月', value: '10', key: 'October'},
{name: '11月', value: '11', key: 'November'},
{name: '12月', value: '12', key: 'December'},
]