update 打包管理、打包项目维护变更
This commit is contained in:
@@ -8,6 +8,7 @@ export const ProjectTypeEnums = {
|
||||
STANDARD_MEMBER_PRO: {name: '标协会员项目', value: 5},
|
||||
STANDARD_CERTIFICATE_PRO: {name: '标协证书项目', value: 6},
|
||||
DRAFT_PRO: {name: '起草组项目', value: 7},
|
||||
PACK_PRO: { name: '打包项目', value: 8 }
|
||||
}
|
||||
|
||||
// 参会人员身份类型
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:scroll="{x: 1600}"
|
||||
:scroll="{x: 2100}"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
@@ -54,6 +54,19 @@
|
||||
:class="dataSource.length === 0 ? 'show-scroll' : ''"
|
||||
class="j-table-force-nowrap main-table">
|
||||
|
||||
<!-- 打包、需要发票、到账、开票、邮寄状态-->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<!-- 项目名称-->
|
||||
<template slot="projectName" slot-scope="text, record">
|
||||
<j-ellipsis :value="text" :length="18" class="primary-color"
|
||||
@@ -76,6 +89,11 @@
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<a @click="incomePayment(record)" :disabled="Number(record.receivableAmount) === 0"
|
||||
v-has="'packProject:incomePayment'">来款</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>
|
||||
<a @click="handleEdit(record)" v-has="'packCompany:edit'">编辑</a>
|
||||
<a @click="handleDelete(record.id)" v-has="'packCompany:delete'">删除</a>
|
||||
</span>
|
||||
@@ -86,7 +104,7 @@
|
||||
ref="footTable"
|
||||
:rowKey="record=>record.id"
|
||||
:columns="columnsFooter"
|
||||
:scroll="{x: 1600}"
|
||||
:scroll="{x: 2100}"
|
||||
:dataSource="footerDataSource"
|
||||
:showHeader="false"
|
||||
:pagination="false"
|
||||
@@ -105,6 +123,32 @@
|
||||
</div>
|
||||
</a-card>
|
||||
<pack-company-module ref="modalForm" @ok="modalFormOk"></pack-company-module>
|
||||
<!-- 来款阶段-->
|
||||
<arrive-stage-module
|
||||
ref="arriveStage"
|
||||
:project-type="projectType"
|
||||
:project-id="selectProjectId"
|
||||
:visible.sync="arriveStageVisible"
|
||||
:need-invoice="selectNeedInvoice"
|
||||
@ok="modalFormOk"></arrive-stage-module>
|
||||
|
||||
<!-- 开票阶段-->
|
||||
<invoicing-stage-module
|
||||
ref="invoicingStage"
|
||||
:visible.sync="invoicingStageVisible"
|
||||
:mail-contacts-id="companyDataById.packContactId"
|
||||
:project-id="selectProjectId"
|
||||
:project-type="projectType"
|
||||
:project-name="selectProjectName"
|
||||
@ok="modalFormOk"></invoicing-stage-module>
|
||||
<!-- 确认收入阶段 -->
|
||||
<confirm-stage-module
|
||||
ref="confirmStageModule"
|
||||
:visible.sync="confirmStageVisible"
|
||||
:project-id="selectProjectId"
|
||||
:project-type="projectType"
|
||||
:project-name="selectProjectName"
|
||||
@ok="modalFormOk"></confirm-stage-module>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -116,6 +160,12 @@ import { JeroListMixin } from '../../mixins/JeroListMixin'
|
||||
import PackCompanyModule from './modules/PackCompanyModule'
|
||||
import {formatMoney} from '@/utils/formatMoney'
|
||||
import {getAction} from '../../api/manage'
|
||||
import StatusSlot from '@comp/tools/StatusSlot'
|
||||
import {getPayConfirmList} from '@api/incomePaymentsApi'
|
||||
import ArriveStageModule from '@views/financialManagement/arriveAndInvoicing/modules/ArriveStageModule'
|
||||
import ConfirmStageModule from '@views/financialManagement/arriveAndInvoicing/modules/ConfirmStageModule'
|
||||
import InvoicingStageModule from '@views/financialManagement/arriveAndInvoicing/modules/InvoicingStageModule'
|
||||
import {ProjectTypeEnums} from '@/enums/commonEnums'
|
||||
|
||||
const defaultTableColumns = [
|
||||
{
|
||||
@@ -173,13 +223,40 @@ const defaultTableColumns = [
|
||||
dataIndex: 'packYear',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
|
||||
{
|
||||
title: '需要发票',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'needInvoice',
|
||||
scopedSlots: { customRender: 'status-pack' }
|
||||
},
|
||||
{
|
||||
title: '到账',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'inAccount',
|
||||
scopedSlots: { customRender: 'status' }
|
||||
},
|
||||
{
|
||||
title: '开票',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'makeInvoice',
|
||||
scopedSlots: { customRender: 'status-bill' }
|
||||
},
|
||||
{
|
||||
title: '确收',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'affirmIncome',
|
||||
scopedSlots: {customRender: 'status-confirm'}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 160,
|
||||
width: 330,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
]
|
||||
@@ -211,11 +288,20 @@ const firstColumnFooter = [
|
||||
|
||||
export default {
|
||||
name: 'PackCompanyList',
|
||||
components: { PageHeaderTitle, JYearDate, PackCompanyModule },
|
||||
components: {
|
||||
InvoicingStageModule,
|
||||
ConfirmStageModule,
|
||||
ArriveStageModule,
|
||||
StatusSlot,
|
||||
PageHeaderTitle,
|
||||
JYearDate,
|
||||
PackCompanyModule
|
||||
},
|
||||
mixins: [JeroListMixin],
|
||||
data() {
|
||||
return {
|
||||
IconImg,
|
||||
footerDataSource: [],
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
@@ -231,11 +317,21 @@ export default {
|
||||
delete: '/pack/payPackCompany/delete',
|
||||
deleteBatch: '/pack/payPackCompany/deleteBatch',
|
||||
exportXlsUrl: '/pack/payPackCompany/exportXls'
|
||||
}
|
||||
},
|
||||
arriveStageVisible: false, // 来款阶段对话框开启状态
|
||||
invoicingStageVisible: false, // 开票阶段对话框开启状态
|
||||
confirmStageVisible: false, // 确认收入阶段对话框开启状态
|
||||
selectProjectId: null, // 选中项目id
|
||||
projectType: ProjectTypeEnums.PACK_PRO.value, // 打包管理项目类型
|
||||
selectProjectName: null, // 选中项目名称
|
||||
selectNeedInvoice: null, // 选中项目是否需要发票
|
||||
// 通过id获取的企业信息
|
||||
companyDataById: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatMoney,
|
||||
getPayConfirmList,
|
||||
/**
|
||||
* 跳转至打包企业维护页面
|
||||
* 路由参数---打包企业的id
|
||||
@@ -317,6 +413,41 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 来款
|
||||
* @param record
|
||||
*/
|
||||
incomePayment(record) {
|
||||
this.selectProjectId = record.id
|
||||
this.arriveStageVisible = true
|
||||
this.selectNeedInvoice = record.needInvoice
|
||||
},
|
||||
/**
|
||||
* 开票
|
||||
* @param record
|
||||
*/
|
||||
invoicing(record) {
|
||||
// if (record.projectType === 5 && record.inAccount !== 1) {
|
||||
// this.$message.warn('标协会员项目必须先到账才可开票。')
|
||||
// return
|
||||
// }
|
||||
this.companyDataById = record
|
||||
this.selectProjectName = record.companyTemporaryName
|
||||
this.selectProjectId = record.id
|
||||
this.invoicingStageVisible = true
|
||||
},
|
||||
/**
|
||||
* 确认收入 -(记录跨年度提前来款)
|
||||
* @param record
|
||||
*/
|
||||
confirmPayment(record) {
|
||||
this.selectProjectId = record.id
|
||||
this.confirmStageVisible = true
|
||||
// 打包项目类型
|
||||
record.projectType = this.projectType
|
||||
this.$refs.confirmStageModule.show(record)
|
||||
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.setScroll()
|
||||
|
||||
@@ -68,11 +68,11 @@
|
||||
<a-button type="danger" icon="close-circle" @click="batchCancelPack" v-has="'packProject:batchCancelPack'">
|
||||
批量取消打包
|
||||
</a-button>
|
||||
<a-button type="primary" icon="pay-circle" @click="batchIncomePayment" v-has="'packProject:batchIncomePayment'">
|
||||
批量来款
|
||||
</a-button>
|
||||
<a-button type="primary" icon="file-text" @click="batchInvoicing" v-has="'packProject:batchInvoicing'">批量开票
|
||||
</a-button>
|
||||
<!-- <a-button type="primary" icon="pay-circle" @click="batchIncomePayment" v-has="'packProject:batchIncomePayment'">-->
|
||||
<!-- 批量来款-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button type="primary" icon="file-text" @click="batchInvoicing" v-has="'packProject:batchInvoicing'">批量开票-->
|
||||
<!-- </a-button>-->
|
||||
<a-button type="primary" icon="export" @click="handleExportXls('打包项目列表')" v-has="'packProject:export'">导出
|
||||
</a-button>
|
||||
</div>
|
||||
@@ -138,14 +138,14 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<a @click="incomePayment(record)" :disabled="Number(record.receivableAmount) === 0"
|
||||
v-has="'packProject:incomePayment'">来款</a>
|
||||
<!-- <a @click="incomePayment(record)" :disabled="Number(record.receivableAmount) === 0"-->
|
||||
<!-- v-has="'packProject:incomePayment'">来款</a>-->
|
||||
<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>
|
||||
<!-- <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>-->
|
||||
<!--工作组项目、普通项目、资料网员项目可以修改发票信息-->
|
||||
<a v-has="'packProject:changeInvoiceInfo'" @click="changeInvoiceInfo(record)" :disabled="Number(record.projectType) !== ProjectTypeEnums.GENERAL_PRO.value && Number(record.projectType) !== ProjectTypeEnums.GROUP_PRO.value && Number(record.projectType) !== ProjectTypeEnums.MEMBER_PRO.value">开票类型</a>
|
||||
<!-- <a v-has="'packProject:changeInvoiceInfo'" @click="changeInvoiceInfo(record)" :disabled="Number(record.projectType) !== ProjectTypeEnums.GENERAL_PRO.value && Number(record.projectType) !== ProjectTypeEnums.GROUP_PRO.value && Number(record.projectType) !== ProjectTypeEnums.MEMBER_PRO.value">开票类型</a>-->
|
||||
</span>
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
ref="footTable"
|
||||
:rowKey="record=>record.id"
|
||||
:columns="columnsFooter"
|
||||
:scroll="{x: 1600}"
|
||||
:scroll="{x: 1000}"
|
||||
:dataSource="footerDataSource"
|
||||
:showHeader="false"
|
||||
:pagination="false"
|
||||
@@ -285,48 +285,6 @@ const defaultTableColumns = [
|
||||
width: 120,
|
||||
dataIndex: 'receivableAmount',
|
||||
scopedSlots: { customRender: 'allMoney' }
|
||||
}, {
|
||||
title: '实收金额',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'paidAmount',
|
||||
scopedSlots: { customRender: 'allMoney' }
|
||||
}, {
|
||||
title: '打包',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'pack',
|
||||
scopedSlots: { customRender: 'status-pack' }
|
||||
}, {
|
||||
title: '需要发票',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'needInvoice',
|
||||
scopedSlots: { customRender: 'status-pack' }
|
||||
}, {
|
||||
title: '到账',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'inAccount',
|
||||
scopedSlots: { customRender: 'status' }
|
||||
}, {
|
||||
title: '收入',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'affirmIncome',
|
||||
scopedSlots: {customRender: 'status-confirm'}
|
||||
}, {
|
||||
title: '开票',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'makeInvoice',
|
||||
scopedSlots: { customRender: 'status-bill' }
|
||||
}, {
|
||||
title: '邮寄',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'mail',
|
||||
scopedSlots: { customRender: 'status-mail' }
|
||||
}, {
|
||||
title: '企业联系人',
|
||||
align: 'center',
|
||||
@@ -350,7 +308,7 @@ const defaultTableColumns = [
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 330,
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
]
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<company-select
|
||||
placeholder="请选择企业"
|
||||
v-decorator="['company', validatorRules.company]"
|
||||
:disabled="disabledCompany"
|
||||
@change="handleCompanyChange">
|
||||
</company-select>
|
||||
</a-form-item>
|
||||
@@ -75,6 +76,138 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="邮寄联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<select-contacts :selected-company="selectedCompany"
|
||||
:init-contacts="initMailContact"
|
||||
placeholder="请选择邮寄联系人"
|
||||
v-decorator="['mailContactsId',validatorRules.mailContactsId]"
|
||||
:maxLength='50'
|
||||
ref="selectMailContacts"
|
||||
@ok="addMailContactsOk"></select-contacts>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="待确收金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row :gutter="10">
|
||||
<a-col :span="20">
|
||||
<a-input placeholder="请输入待确收金额"
|
||||
v-decorator="['receivableAmount',validatorRules.receivableAmount]"
|
||||
:maxLength='50'
|
||||
@blur="addZero"
|
||||
@change="changeReceivableAmount"></a-input>
|
||||
</a-col>
|
||||
<a-col :span="1">元</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="税率" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag @change="changeRate" placeholder="请选择税率" dict-code="rate" :trigger-change="true" v-decorator="['taxRate',validatorRules.taxRate]"></j-dict-select-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="税额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row :gutter="10">
|
||||
<a-col :span="20">
|
||||
<a-input placeholder="请输入税额"
|
||||
v-decorator="['tax',validatorRules.tax]"
|
||||
:maxLength='50'
|
||||
@blur="addZero"
|
||||
read-only
|
||||
disabled
|
||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||
</a-col>
|
||||
<a-col :span="1">元</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="未税金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row :gutter="10">
|
||||
<a-col :span="20">
|
||||
<a-input placeholder="请输入未税金额"
|
||||
v-decorator="['noTaxAmount',validatorRules.noTaxAmount]"
|
||||
:maxLength='50'
|
||||
disabled
|
||||
@blur="addZero"
|
||||
read-only
|
||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||
</a-col>
|
||||
<a-col :span="1">元</a-col>
|
||||
</a-row>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="预估到账日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择预估到账日期"
|
||||
style="width: 100%;"
|
||||
v-decorator="['estimatedArrivalDate', validatorRules.estimatedArrivalDate]"
|
||||
:trigger-change="true"
|
||||
date-format="YYYY-MM-DD"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="需要发票" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-dict-select-tag v-decorator="['needInvoice',validatorRules.needInvoice]"
|
||||
:maxLength='50'
|
||||
:triggerChange="true"
|
||||
placeholder="请选择发票类型"
|
||||
dictCode="invoice_type"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="来款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-radio-group v-decorator="['chargeWay',validatorRules.chargeWay]"
|
||||
@change="handlechargeWayChange"
|
||||
:disabled="isAssociatedContract">
|
||||
<a-radio :value="1">无</a-radio>
|
||||
<a-radio :value="2">合同</a-radio>
|
||||
<a-radio :value="3">收费通知</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="合同号" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="chargeWayType === 2">
|
||||
<select-revenue-contract
|
||||
placeholder="请选择合同号"
|
||||
:company="selectedCompany"
|
||||
v-decorator="['contractNum',validatorRules.contractNum]"
|
||||
:disabled="isContractNumDisabled || isAssociatedContract">
|
||||
</select-revenue-contract>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row v-if="chargeWayType === 3">
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="收费通知号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入收费通知号"
|
||||
v-decorator="['chargeNoticeNo',validatorRules.chargeNoticeNo]"
|
||||
:maxLength='50'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="收费通知" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-upload file-type-error-message="请上传收费通知"
|
||||
:multiple="true"
|
||||
:return-id="true"
|
||||
:number="1"
|
||||
bizPath="payment"
|
||||
v-decorator="['chargeNoticeId', validatorRules.chargeNoticeId]"
|
||||
:trigger-change="true"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col>
|
||||
<a-form-item label="打包费用说明" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||
@@ -113,10 +246,28 @@ import JYearDate from '../../../components/jero/JYearDate'
|
||||
import { money } from '../../../utils/validate'
|
||||
import { addZero } from '../../../utils/util'
|
||||
import SelectPrincipal from '@comp/company/SelectPrincipal.vue'
|
||||
import SelectRevenueContract from '@comp/tools/SelectRevenueContract'
|
||||
import JUpload from '@comp/jero/JUpload'
|
||||
import JDate from '@comp/tools/JDate'
|
||||
import {checkAssociatedProject} from '@/utils/projectCheck'
|
||||
|
||||
export default {
|
||||
name: 'PackCompanyModule',
|
||||
components: { CompanySelect, SelectContacts, JYearDate, SelectPrincipal },
|
||||
components: {JDate, JUpload, SelectRevenueContract, CompanySelect, SelectContacts, JYearDate, SelectPrincipal },
|
||||
props: {
|
||||
// 合同号是否可编辑
|
||||
isContractNumDisabled: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 是否可以修改来款企业
|
||||
disabledChargeCompany: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
@@ -145,8 +296,7 @@ export default {
|
||||
add: '/pack/payPackCompany/add',
|
||||
edit: '/pack/payPackCompany/edit'
|
||||
},
|
||||
selectedCompany: null,
|
||||
validatorRules: {
|
||||
validatorRules: {
|
||||
packChargeTotal: {
|
||||
rules: [{ required: true, validator: this.checkMoney }],
|
||||
validateTrigger: 'blur'
|
||||
@@ -170,10 +320,56 @@ export default {
|
||||
packPrincipalId: {
|
||||
rules: [{ required: true, message: '请选择打包负责人' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
mailContactsId: {
|
||||
rules: [{ required: true, message: '请选择邮寄联系人' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
taxRate: {
|
||||
rules: [{ required: true,message: '请选择税率' }],
|
||||
validateTrigger: 'change',initialValue:'0.06'
|
||||
},
|
||||
receivableAmount: {
|
||||
rules: [{ required: true, validator: this.checkMoney }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
tax: {
|
||||
rules: [{ required: false, validator: this.checkTaxMoney }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
noTaxAmount: {
|
||||
rules: [{ required: false, validator: this.checkNoTaxMoney}],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
estimatedArrivalDate: {
|
||||
rules: [{ required: true, message: '请选择预估到账日期' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
needInvoice: {
|
||||
rules: [{ required: true, message: '请选择发票类型' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
chargeWay: {
|
||||
rules: [{ required: true, message: '请选择来款方式' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
contractNum: {
|
||||
rules: [{ required: true, message: '请选择合同号' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
chargeNoticeNo: {
|
||||
rules: [{ required: true, message: '请输入收费通知号' }],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
initContact: null, // 编辑回显的企业联系人信息
|
||||
initPackContact: null // 编辑回显的打包联系人信息
|
||||
initPackContact: null, // 编辑回显的打包联系人信息
|
||||
/* 2024年2月变更 */
|
||||
chargeWayType: null, // 来款方式
|
||||
selectedCompany: null, // 当前选中的企业
|
||||
initMailContact: null, // 编辑时的邮寄联系人
|
||||
disabledCompany: false, // 企业是否可以编辑
|
||||
isAssociatedContract: false, // 是否已关联合同
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -189,9 +385,20 @@ export default {
|
||||
}
|
||||
// 回显企业信息
|
||||
this.selectedCompany = record.company
|
||||
this.chargeWayType = record.chargeWay
|
||||
record.companyContactId = record.companyContactTemporaryId
|
||||
record.packContactId = record.packContactTemporaryId
|
||||
// 编辑时,将企业联系人、打包联系人添加至候选项中
|
||||
// 判断企业是否可以编辑,项目来款、开票、邮寄、打包、关联合同后,企业不可更改
|
||||
if (record.id) {
|
||||
// 验证项目是否关联收入合同
|
||||
checkAssociatedProject(record.id).then(res => {
|
||||
this.disabledCompany = this.disabledChargeCompany || res || (!!record.inAccount && record.inAccount !== 0) || (!!record.makeInvoice && record.makeInvoice !== 0) || (!!record.mail && record.mail !== 0)
|
||||
this.isAssociatedContract = res
|
||||
})
|
||||
} else {
|
||||
this.disabledCompany = this.disabledChargeCompany
|
||||
}
|
||||
// 编辑时,将企业联系人、打包联系人、邮寄联系人添加至候选项中
|
||||
if (record.id) {
|
||||
this.initContact = {
|
||||
id: record.companyContactTemporaryId,
|
||||
@@ -201,11 +408,35 @@ export default {
|
||||
id: record.packContactTemporaryId,
|
||||
name: record.packContactTemporaryName
|
||||
}
|
||||
this.initMailContact = {
|
||||
id: record.mailContactsTemporaryId,
|
||||
name: record.mailContactsTemporaryName
|
||||
}
|
||||
}
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'company', 'companyContactId', 'packYear', 'packChargeTotal', 'packContactId', 'packChargeRemark', 'remark', 'packPrincipalId'))
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'company',
|
||||
'companyContactId',
|
||||
'packYear',
|
||||
'packChargeTotal',
|
||||
'packContactId',
|
||||
'packChargeRemark',
|
||||
'remark',
|
||||
'packPrincipalId',
|
||||
'mailContactsId',
|
||||
'receivableAmount',
|
||||
'taxRate',
|
||||
'tax',
|
||||
'noTaxAmount',
|
||||
'estimatedArrivalDate',
|
||||
'needInvoice',
|
||||
'chargeWay',
|
||||
'contractNum',
|
||||
'chargeNoticeNo',
|
||||
'chargeNoticeId'
|
||||
))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
@@ -214,6 +445,9 @@ export default {
|
||||
// 清空选中联系人相关信息
|
||||
this.initContact = null
|
||||
this.initPackContact = null
|
||||
this.initMailContact = null
|
||||
// 清空来款方式
|
||||
this.chargeWayType = null
|
||||
},
|
||||
handleOk() {
|
||||
if (this.confirmLoading) {
|
||||
@@ -303,7 +537,89 @@ export default {
|
||||
return
|
||||
}
|
||||
callback('请选择企业')
|
||||
}
|
||||
},
|
||||
/* 2024年2月变更 */
|
||||
/**
|
||||
* 在新增成功后重新获取联系人列表
|
||||
*/
|
||||
addMailContactsOk() {
|
||||
this.$refs.selectContacts.getContactsList()
|
||||
},
|
||||
/**
|
||||
* 改变待确收金额 计算税额 未税金额
|
||||
* */
|
||||
changeReceivableAmount(e){
|
||||
e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()
|
||||
this.$nextTick(() => {
|
||||
this.calcAmount()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 改变税率计算税额 待确收金额
|
||||
* */
|
||||
changeRate(){
|
||||
this.$nextTick(() => {
|
||||
this.calcAmount()
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 来款方式变化
|
||||
* @param e
|
||||
*/
|
||||
handlechargeWayChange(e) {
|
||||
this.chargeWayType = e.target.value
|
||||
},
|
||||
/**
|
||||
* 校验税额金额格式
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkTaxMoney(rules, value, callback) {
|
||||
console.log(value, rules.field)
|
||||
if (value) {
|
||||
if (money(value)) {
|
||||
callback()
|
||||
}
|
||||
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 校验未税金额金额格式
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkNoTaxMoney(rules, value, callback) {
|
||||
if (value) {
|
||||
if (money(value)) {
|
||||
callback()
|
||||
}
|
||||
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||
}else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 根据待确收金额、税率计算税额 、未税金额
|
||||
* */
|
||||
calcAmount(){
|
||||
// 获取待确收金额
|
||||
let ysje = Number(this.form.getFieldValue('receivableAmount'))
|
||||
// 获取税率
|
||||
let rate = this.form.getFieldValue('taxRate') * 1
|
||||
// 计算未税金额 未税金额 = 待确收金额 * (税率 + 1)
|
||||
let wsje = (ysje / (rate + 1)).toFixed(2)
|
||||
// 计算税额 税额 = 待确收金额 - 未税金额 保留两位小数
|
||||
let se = (ysje - Number(wsje)).toFixed(2)
|
||||
// 表单赋值
|
||||
this.form.setFieldsValue({
|
||||
'tax':se,
|
||||
'noTaxAmount':wsje
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user