Files
income_payments_enterprise_…/src/views/standardsAssociation/PaymentInfo/modules/CertificatePaymentInfoModal.vue
T

880 lines
32 KiB
Vue

<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form" style="margin-left: 10px">
<a-divider orientation="left">
证书缴费信息
</a-divider>
<a-row>
<a-col :span="12">
<a-form-item label="单位全称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled=true v-model="companyName" placeholder="请输入单位名称"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled=true v-model="liaisonMan" placeholder="请输入联系人"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="手机" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled=true v-model="mobile" placeholder="请输入手机号"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="缴费方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:disabled="checkFlag||detailFlag" type="list"
v-decorator="['paymentMethod',validatorRules.paymentMethod]" :trigger-change="true"
dictCode="payment_method" placeholder="请选择缴费方式" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="缴费类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:disabled=true type="list" v-decorator="['paymentType']" :trigger-change="true"
dictCode="certificate_payment_type" placeholder="请选择缴费类型" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="缴费单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled=true v-decorator="['billNumber']" placeholder="请输入缴费单号"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="缴费金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
:disabled="checkFlag||detailFlag"
v-decorator="['paymentAmount',validatorRules.paymentAmount]" placeholder="请输入缴费金额"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="缴费时长" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:disabled="checkFlag||detailFlag" @change="changgeType" type="list"
v-decorator="['paymentTime',validatorRules.paymentTime]" :trigger-change="true"
dictCode="payment_time" placeholder="请选择缴费时长" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="缴费日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date
:disabled="checkFlag||detailFlag" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择缴费时间"
v-decorator="['submissionTime',validatorRules.submissionTime]" :trigger-change="true"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12" v-if="paymentMethodFlag==1">
<a-form-item label="缴费凭证" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload
isLessThan5M
isMultiple
:number="2"
:disabled="checkFlag||detailFlag"
bizPath="payment"
v-decorator="['paymentRecord',validatorRules.paymentRecord]">
</j-image-upload>
</a-form-item>
</a-col>
<a-row>
<a-col :span="12" v-if="paymentMethodFlag==2">
<a-form-item label="打包协议" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-upload
file-type="pdf"
file-type-error-message="请上传pdf文件" :multiple="false" :number="1"
:disabled="checkFlag||detailFlag" bizPath="payment"
v-decorator="['paymentRecord',validatorRules.paymentRecord]"
:trigger-change="true"></j-upload>
<span v-show="!detailFlag && !checkFlag" style="color: #bfbfbf">请上传pdf文件</span>
</a-form-item>
</a-col>
</a-row>
</a-row>
<div v-if="paymentMethodFlag==1">
<a-row>
<a-col :span="12">
<a-form-item label="发票" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:disabled="checkFlag||detailFlag" @change="invoiceRequirementsChange" type="list"
v-decorator="['invoiceRequirements']" :trigger-change="true"
dictCode="invoice_requirements" placeholder="请选择发票" />
</a-form-item>
</a-col>
<a-col :span="12" v-if="invoiceRequirementsFlag">
<a-form-item label="关联付款发票名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag"
v-decorator="['headerName',validatorRules.headerName]"
:trigger-change="true" placeholder="请输入关联付款发票名称"></a-input>
</a-form-item>
</a-col>
</a-row>
<template v-if="invoiceRequirementsFlag">
<a-row>
<a-col :span="12">
<a-form-item label="社会统一代码/税号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag" v-decorator="['taxNumber',validatorRules.taxNumber]"
placeholder="请输入社会统一代码/税号"></a-input>
</a-form-item>
</a-col>
<!-- 2021-09-23变更 增加 单位地址 增值税发票的时候存在-->
<a-col :span="12" v-if="currentSelectInvoiceType === 2">
<a-form-item label="单位地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag"
@change="event => event.target.value = event.target.value.trim()"
v-decorator="['invoiceAddress', validatorRules.invoiceAddress]"
placeholder="请输入单位地址"
:maxLength="50"></a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 2021-09-23变更 增加 电话号码 开户银行 银行账户 增值税发票的时候存在-->
<a-row v-if="currentSelectInvoiceType === 2">
<a-col :span="12">
<a-form-item label="电话号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag"
v-decorator="['invoicePhone', validatorRules.invoicePhone]"
:trigger-change="true"
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9|-]/g,'')}"
placeholder="请输入电话号码"
:maxLength="50"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="开户银行" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag"
@change="event => event.target.value = event.target.value.trim()"
v-decorator="['depositBank', validatorRules.depositBank]"
placeholder="请输入开户银行"
:maxLength="50"></a-input>
</a-form-item>
</a-col>
</a-row>
<a-row v-if="currentSelectInvoiceType === 2">
<a-col :span="12">
<a-form-item label="银行账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:disabled="checkFlag||detailFlag"
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9]/g,'')}"
v-decorator="['bankAccount', validatorRules.bankAccount]"
placeholder="请输入银行账户"
:maxLength="50"></a-input>
</a-form-item>
</a-col>
</a-row>
</template>
</div>
<!-- 缴费备注-->
<a-row>
<a-col :span="24" class="remark">
<a-form-item label="备注" :labelCol="labelColText" :wrapperCol="wrapperCol">
<a-textarea
rows="5" v-decorator="['paymentMark' ]" placeholder="请输入备注" disabled
:maxLength="500"></a-textarea>
</a-form-item>
<span style="color: #bfbfbf" v-show="!detailFlag && !checkFlag">一个缴费单可在多个缴费处上传</span>
</a-col>
</a-row>
<div v-show="typeFlag">
<a-divider orientation="left">证书需求</a-divider>
<a-table
:pagination=false bordered :data-source="dataSource" :columns="columns"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,getCheckboxProps:getCheckboxProps }">
<template slot="imgSlot" slot-scope="text, record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text,record)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;" />
</template>
</a-table>
<div style="position: relative;top: 20px;">
<a-row>
<a-col :span="12">
<a-form-item label="通讯地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled="checkFlag||detailFlag" v-model="address" placeholder="请输入通讯地址"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :disabled="checkFlag||detailFlag" v-model="postcode" placeholder="请输入邮编"></a-input>
</a-form-item>
</a-col>
</a-row>
</div>
</div>
<div v-show="checkFlag">
<a-divider orientation="left">审核结果</a-divider>
<a-row>
<a-col :span="12">
<a-form-item label="核对结果" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['checkResult',validatorRules.checkResult]" @change="onCheckChange">
<a-radio :value="1">通过</a-radio>
<a-radio :value="0">不通过</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
rows="5" v-decorator="['checkMark',validatorRules.checkMark]" placeholder="请输入备注"
:maxLength="500"></a-textarea>
</a-form-item>
</a-col>
</a-row>
</div>
<div v-show="detailFlag">
<a-divider orientation="left">审核信息</a-divider>
<a-table :pagination=false bordered :data-source="checkInfo" :columns="checkColumns">
</a-table>
</div>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-show="!detailFlag" :disabled="confirmLoading">提交</a-button>
</template>
</j-modal>
</template>
<script>
import { httpAction, getFileAccessHttpUrl } from '@/api/memberManage'
import pick from 'lodash.pick'
import JDate from '@/components/tools/JDate'
import JUpload from '@/components/standardsAssociation/JUpload'
import JImageUpload from '@/components/standardsAssociation/JImageUpload'
import JDictSelectTag from '@/components/standardsAssociation/JDictSelectTag'
import { getMemberInfoById, getCertificateById, getCheckInfo, getByMemberTime } from '@/api/standardsAssociationApi'
export default {
name: 'CertificatePaymentInfoModal',
components: {
JDate,
JImageUpload,
JUpload,
JDictSelectTag
},
data() {
return {
userId: this.$store.getters.userInfo.memberId,
// userName: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.realname,
userName: '',
form: this.$form.createForm(this),
title: '操作',
width: 1100,
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
labelColText: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
confirmLoading: false,
validatorRules: {
paymentMethod: {
rules: [{
required: true, message: '请选择缴费方式'
}],
validateTrigger: ['blur', 'change']
},
paymentType: {
rules: [{
required: true, message: '请选择缴费类型'
}],
validateTrigger: ['blur', 'change']
},
billNumber: {
rules: [{
required: true, message: '请输入缴费单号'
}],
validateTrigger: 'blur'
},
paymentAmount: {
rules: [
{ required: true, message: '请输入缴费金额' },
{
pattern: /^[1-9](\d{1,10})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{0,10}$|^0$/,
message: '请输入合法的金额数字,最多2位小数,11位正数',
trigger: 'blur'
}
],
validateTrigger: 'blur'
},
paymentTime: {
rules: [{ required: true, message: '请选择缴费时长' }],
validateTrigger: ['blur', 'change']
},
submissionTime: {
rules: [{ required: true, message: '请选择缴费日期!' }],
validateTrigger: ['blur', 'change']
},
paymentRecord: {
rules: [{ required: true, message: '请上传缴费凭证' }],
validateTrigger: ['blur', 'change']
},
headerName: {
rules: [
{ required: true, message: '请输入关联付款发票名称' },
{ min: 1, max: 50, message: '长度不超过50个字符' }
],
validateTrigger: 'blur'
},
taxNumber: {
rules: [
{ required: true, message: '请输入社会统一代码/税号' },
// { pattern: /^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/, message: '15位、17位、18位、20位数字和大写英文字母' }
{
pattern: /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/,
message: '请输入15位、18位的社会统一代码/税号'
}
],
validateTrigger: 'blur'
},
invoiceAddress: { rules: [{ required: true, message: '请输入单位地址' }], validateTrigger: 'blur' },
invoicePhone: {
rules: [
{ required: true, message: '请输入电话号码' },
{
pattern: /^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\d{8}$|^([0-9]{3,4}-)[0-9]{7,8}$/,
message: '请输入正确格式的电话号码',
validateTrigger: 'onBlur'
}
],
validateTrigger: 'blur'
},
depositBank: { rules: [{ required: true, message: '请输入开户银行' }], validateTrigger: 'blur' },
bankAccount: { rules: [{ required: true, message: '请输入银行账户' }], validateTrigger: 'blur' },
address: {
rules: [
{ required: true, message: '请输入通讯地址' },
{ min: 1, max: 50, message: '长度不超过50个字符' }
],
validateTrigger: 'blur'
},
postcode: {
rules: [
{ required: true, message: '请输入邮编' },
{ pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮编' }
],
validateTrigger: 'blur'
},
checkResult: {
rules: [
{ required: true, message: '请选择核对结果' }
],
validateTrigger: ['blur', 'change']
},
checkMark: {
rules: [
{ min: 0, max: 500, message: '长度不超过500个字符' }
],
validateTrigger: 'blur'
}
},
url: {
add: '/certificatePaymentInfo/add',
edit: '/certificatePaymentInfo/edit'
},
// 缴费类型 普通会员 false vip会员 true
typeFlag: false,
// 添加
addFlag: false,
// 审核
checkFlag: false,
// 证书回显
certificatesFlag: false,
// 查看
detailFlag: false,
// 发票 否 false 是 ture
invoiceRequirementsFlag: false,
// 当前选择是否需要发票的值,用于dom的判断 0-无 1-普通发票 2-增值税发票
currentSelectInvoiceType: 0,
startTime: '',
endTime: '',
// 申请证书
selectedRowKeys: [],
// 证书信息
dataSource: [],
count: 2,
// 证书列表
columns: [
{
title: '序号',
dataIndex: 'index',
width: '10%',
align: 'center'
},
{
title: '证书类型',
dataIndex: 'certificate',
width: '20%',
align: 'center'
},
{
title: '证书代码',
dataIndex: 'certificate_code',
width: '30%',
scopedSlots: { customRender: 'code' },
align: 'center'
},
{
title: '证书示意图',
dataIndex: 'text',
width: '30%',
align: 'center',
scopedSlots: { customRender: 'imgSlot' }
}
],
// 审核结果 0:驳回 1:通过 2其他
checkResult: 2,
memberId: '',
// 公司名称
companyName: '',
// 联系人
liaisonMan: '',
// 电话
mobile: '',
// 地址
address: '',
// 邮编
postcode: '',
certificate: [], // 证书信息
checkInfo: [], // 审核信息
// 审核列表
checkColumns: [
{
title: '序号',
dataIndex: 'index',
width: '10%',
align: 'center'
},
{
title: '审批人',
dataIndex: 'checkMember',
width: '15%',
align: 'center'
},
{
title: '审批时间',
dataIndex: 'checkTime',
width: '20%',
align: 'center'
},
{
title: '结果',
dataIndex: 'checkResult',
width: '15%',
align: 'center'
},
{
title: '备注',
dataIndex: 'checkMark',
width: '40%',
align: 'center'
}
],
// 缴费方式 电汇:1 会员打包:2
paymentMethodFlag: '',
submitFlag: true
}
},
created() {
},
methods: {
/* 添加*/
add() {
this.addFlag = true
this.memberId = this.userId
this.edit({})
},
check() {
this.checkFlag = true
this.memberId = this.userId
this.edit({})
},
/* 审核*/
handleCheck(record) {
this.paymentMethodFlag = record.paymentMethod
this.checkFlag = true
this.form.resetFields()
this.model = Object.assign({}, record)
if (!this.addFlag) {
this.memberId = this.model.memberId
this.loadMember()
} else {
this.memberId = this.userId
this.loadMember()
this.model.certificate = this.certificate
}
// 查找证书信息
this.getCertificateById(record.certificateId)
var type = this.model.paymentTime
// 会员类型
this.changgeType(type)
this.visible = true
// 审核人
this.model.checkMember = this.userName
this.model.checkMemberId = this.userId
// 查找审核信息
this.getCheckInfo(record.id)
this.model.certificate = this.certificate
this.checkResult = this.model.checkResult
// 发票选择
if (Number(record.invoiceRequirements) === 0) {
this.invoiceRequirementsFlag = false
} else {
this.invoiceRequirementsFlag = true
}
this.currentSelectInvoiceType = Number(record.invoiceRequirements)
// 审核信息
this.checkResult = this.model.checkResult
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'billNumber', 'companyName', 'paymentType', 'validPeriod', 'paymentTime', 'paymentAmount', 'certificatesNum', 'submissionTime', 'checkTime', 'paymentStatus', 'paymentMethod', 'paymentRecord', 'invoiceRequirements', 'headerName', 'taxNumber', 'invoiceAddress', 'invoicePhone', 'depositBank', 'bankAccount', 'checkMember', 'checkMemberId', 'memberId', 'certificate', 'address', 'postcode', 'serviceCharge', 'paymentMark'))
})
},
detail(record) {
this.paymentMethodFlag = record.paymentMethod
this.detailFlag = true
this.form.resetFields()
this.model = Object.assign({}, record)
if (!this.addFlag) {
this.memberId = this.model.memberId
this.loadMember()
} else {
this.memberId = this.userId
this.loadMember()
this.model.certificate = this.certificate
}
this.getCertificateById(record.certificateId)
this.getCheckInfo(record.id)
var type = this.model.paymentTime
this.changgeType(type)
this.visible = true
this.model.memberId = this.memberId
if (this.model.certificatesNum > 0) {
this.certificatesFlag = true
} else {
this.certificatesFlag = false
}
this.model.certificate = this.certificate
this.checkResult = this.model.checkResult
// 发票选择
if (Number(record.invoiceRequirements) === 0) {
this.invoiceRequirementsFlag = false
} else {
this.invoiceRequirementsFlag = true
}
this.currentSelectInvoiceType = Number(record.invoiceRequirements)
// 审核信息
this.checkResult = this.model.checkResult
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'billNumber', 'companyName', 'paymentType', 'validPeriod', 'paymentTime', 'paymentAmount', 'certificatesNum', 'submissionTime', 'checkTime', 'paymentStatus', 'paymentMethod', 'paymentRecord', 'invoiceRequirements', 'headerName', 'taxNumber', 'invoiceAddress', 'invoicePhone', 'depositBank', 'bankAccount', 'checkResult', 'checkMark', 'checkMember', 'checkMemberId', 'memberId', 'certificate', 'address', 'postcode', 'paymentMark', 'serviceCharge'))
})
},
/* 备用,目前用不到*/
edit(record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.getCertificateById(record.certificateId)
this.getCheckInfo(record.id)
var type = this.model.paymentTime
this.changgeType(type)
if (!this.addFlag) {
this.memberId = this.model.memberId
} else {
this.model.certificate = this.certificate
this.model.headerName = this.headerName
this.model.taxNumber = this.taxNumber
}
this.visible = true
this.model.memberId = this.memberId
if (this.model.certificatesNum > 0) {
this.certificatesFlag = true
} else {
this.certificatesFlag = false
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'billNumber', 'companyName', 'paymentType', 'validPeriod', 'paymentTime', 'paymentAmount', 'certificatesNum', 'submissionTime', 'checkTime', 'paymentStatus', 'paymentMethod', 'paymentRecord', 'invoiceRequirements', 'headerName', 'taxNumber', 'invoiceAddress', 'invoicePhone', 'depositBank', 'bankAccount', 'checkResult', 'checkMark', 'checkMember', 'checkMemberId', 'memberId', 'certificate', 'address', 'postcode'))
})
},
close() {
this.$emit('close')
this.visible = false
this.addFlag = false
this.typeFlag = false
this.checkFlag = false
this.checkResult = 2
this.certificatesFlag = false
this.dataSource = []
this.checkInfo = []
this.detailFlag = false
this.selectedRowKeys = []
this.invoiceRequirementsFlag = false
this.currentSelectInvoiceType = 0
this.paymentMethodFlag = ''
this.submitFlag = true
},
handleOk() {
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true
let httpurl = ''
let method = ''
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
}
if (this.checkResult === 0) {
this.checkResult = 2
this.model.paymentStatus = 2
} else if (this.checkResult === 1) {
this.checkResult = 2
this.model.paymentStatus = 3
} else {
this.model.paymentStatus = 1
}
const formData = Object.assign(this.model, values)
// if (this.typeFlag) {
// formData.paymentType = 1;
// } else {
// formData.paymentType = 0;
// }
this.model.address = this.address
this.model.postcode = this.postcode
this.model.companyName = this.companyName
console.log('表单提交数据', formData)
httpAction(httpurl, formData, method).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
that.close()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
})
}
})
},
handleCancel() {
this.close()
},
popupCallback(row) {
this.form.setFieldsValue(pick(row, 'billNumber', 'paymentType', 'validPeriod', 'paymentTime', 'paymentAmount', 'certificatesNum', 'submissionTime', 'checkTime', 'paymentStatus', 'paymentMethod', 'paymentRecord', 'invoiceRequirements', 'headerName', 'taxNumber', 'invoiceAddress', 'invoicePhone', 'depositBank', 'bankAccount', 'checkResult', 'checkMark', 'checkMember', 'checkMemberId', 'memberId', 'certificate', 'address', 'postcode'))
},
// 根据会员id获取会员信息
loadMember() {
getMemberInfoById({ id: this.memberId }).then((res) => {
if (res.success) {
var memberInfo = res.result
this.companyName = memberInfo.companyName
this.liaisonMan = memberInfo.liaisonMan
this.mobile = memberInfo.mobile
this.address = memberInfo.address
this.postcode = memberInfo.postcode
} else {
console.log(res.message)
}
})
},
/* 会员类型*/
changgeType(value) {
if (value === '2') {
// 5年
this.typeFlag = true
} else {
this.typeFlag = false
}
},
onCheckChange(e) {
this.checkResult = e.target.value
},
/* 选择发票*/
invoiceRequirementsChange(value) {
this.currentSelectInvoiceType = Number(value)
if (this.currentSelectInvoiceType === 0) {
this.invoiceRequirementsFlag = false
} else {
this.invoiceRequirementsFlag = true
}
},
// table选择
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
this.model.certificatesNum = this.selectedRowKeys.length
for (var i in selectedRowKeys) {
this.certificate[i] = this.dataSource[i]
}
},
// 设置证书选中 禁用
getCheckboxProps: record => ({
props: {
disabled: record.id !== '',
// 某几项默认选中(R: 当state等于1时)
defaultChecked: record.id
}
}),
// 证书code改变
onCellChange(key, dataIndex, value) {
const dataSource = [...this.dataSource]
const target = dataSource.find(item => item.key === key)
if (target) {
target[dataIndex] = value
this.dataSource = dataSource
}
},
/* 图片预览 */
getImgView(text) {
if (text && text.indexOf(',') > 0) {
text = text.substring(0, text.indexOf(','))
}
return getFileAccessHttpUrl(text)
},
/* 查找证书信息*/
getCertificateById(certificateId) {
this.dataSource = []
if (this.addFlag) {
this.dataSource = [
{
id: '',
key: 0,
index: '1',
certificate: '世界制造厂识别代号(WMI)证书',
certificate_code: '',
text: 'payment/Snipaste_2020-12-23_17-30-29_1608894552133.png'
},
{
id: '',
key: 1,
index: '2',
certificate: '企业名称代号证书',
certificate_code: '',
text: 'payment/Snipaste_2020-12-23_17-30-29_1608894552133.png'
}
]
this.certificate = this.dataSource
} else {
getCertificateById({ id: certificateId }).then((res) => {
if (res.success) {
this.dataSource = []
this.dataSource = res.result
this.certificate = this.dataSource
} else {
this.dataSource = []
this.certificate = this.dataSource
}
})
}
},
/* 查找审核信息*/
getCheckInfo(recordId) {
this.checkInfo = []
getCheckInfo({ id: recordId, paymentType: 1 }).then((res) => {
if (res.success) {
this.checkInfo = res.result
}
})
},
/* 根据缴费时长,获取缴费金额*/
getByMemberTime(rule, value, callback) {
const type = this.form.getFieldValue('paymentTime')
if (type === undefined) {
callback(new Error('请选择'))
}
/* 校验时间和金额*/
getByMemberTime({ memberTime: type }).then((res) => {
if (res.success) {
const thresholdSettings = res.result
for (var thresholdSetting of thresholdSettings) {
const paymentAmount = this.form.getFieldValue('paymentAmount')
if (paymentAmount) {
if (paymentAmount < thresholdSetting.memberMoney) {
callback('输入金额与时间不符')
} else {
callback()
}
} else {
callback('请先输入金额')
}
}
}
})
}
}
}
</script>
<style scoped lang="less">
.table {
width: 100%;
height: 180px;
text-align: center;
margin-bottom: 10px;
border-color: #ccc;
border-collapse: collapse;
}
.remark span {
display: inline-block;
font-size: 14px;
//margin-left: 100px;
transform: translateY(-20px);
}
// 2021-09-23 新增固定宽度
/deep/ .ant-form-item-label {
width: 140px !important;
}
</style>