Files
income_payments_client/src/views/incomePayments/meetManage/SignUpInfoEdit.vue
T

1078 lines
40 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<page-header-title :is-level-one="false" :level-two-title="title"></page-header-title>
<a-card :bordered="false">
<a-spin :spinning="confirmLoading">
<a-form :form="form" v-if="!isOverseasMeeting">
<!--个人信息begin-->
<div class="item-title">个人信息</div>
<a-row :gutter="24">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="参会企业" :labelCol="labelCol" :wrapperCol="wrapperCol">
<add-meeting-company @change="changeCompany" v-decorator="['companyId',validatorRules.companyId]"
placeholder="请选择参会企业"
full-company-info
:disabled="model.checkResult === 1"
:maxLength='50'>
</add-meeting-company>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" type="flex">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<select-contacts :selected-company="selectedCompany"
placeholder="请选择参会人"
v-decorator="['companyContactId',validatorRules.companyContactId]"
:maxLength='50'
:disabled="model.checkResult === 1"
:init-contacts="selectPerson"
@change="changeContact"
ref="selectMailContacts"
@ok="addContactsOk"></select-contacts>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号"
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9]/g,'')}"
:maxLength='11'
disabled
v-decorator="['phone',validatorRules.phone]"></a-input>
</a-form-item>
</a-col>
<!--国际研讨会-职务-->
<a-col :xxl="8" :xl="12" :sm="24" v-if="meetingType === MeetingTypeEnums.internationalSeminar.value ">
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入职务"
:maxLength='50'
v-decorator="['post',validatorRules.post]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!--内部企业的时候不允许进行修改参会身份-->
<a-radio-group :disabled="identifyType === 3" v-decorator="['identity',validatorRules.identify]" @change="changeIdentify">
<a-radio :value="1">嘉宾</a-radio>
<a-radio :value="2">参会人</a-radio>
<a-radio :value="3" :disabled="!isInternalEnterprise">内部企业</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<!--身份选择嘉宾并且是研讨会议出现且必填-->
<a-col :xxl="8" :xl="12" :sm="24" v-if="identifyType === 1 && meetingType === '3' ">
<a-form-item label="嘉宾类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['guestType',validatorRules.guestType]" @change="changeGuestType">
<a-radio :value="1">VIP(吃饭+住宿+接站)</a-radio>
<a-radio :value="2">演讲嘉宾(吃饭+接站)</a-radio>
<a-radio :value="3">特邀嘉宾(接站)</a-radio>
<a-radio :value="4">合作伙伴(只登记行程)</a-radio>
<a-radio :value="5">参展商类别(只登记行程)</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" v-if="currentMeetingInfo.isWasic">
<!-- 国际研讨会 WASIC 增加会议名称的选择--已经到账的信息不能修改-->
<a-col :xxl="8" :xl="12" :sm="24" v-if="currentMeetingInfo.isWasic">
<a-form-item label="会议名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!--<j-multi-select-tag-->
<!-- v-decorator="['choiceTopic',validatorRules.choiceTopic]"-->
<!-- :trigger-change="true"-->
<!-- style="width: 100%"-->
<!-- dict-code="linkTopics"-->
<!-- placeholder="请选择会议名称"-->
<!-- :options="linkTopicsOptionArr"-->
<!-- type="checkbox"-->
<!-- class="meeting-form-multi-select"-->
<!-- :disabled="model.inAccount === 1"-->
<!--&gt;-->
<!--</j-multi-select-tag>-->
<a-checkbox-group class="meeting-form-multi-select" @change="choiceTopicChange" v-decorator="['choiceTopic',validatorRules.choiceTopic]" :disabled="model.inAccount === 1">
<div v-for="(item, index) in showTopicsArr" :key="'showTopicTitle_'+ index">
<div class="topic-title">{{item.name}}</div>
<div>
<a-checkbox v-for="item in item.children" :key="'a_checkbox_'+ item.value" :value="item.value" :disabled="item.disabled">{{ item.text }}</a-checkbox>
</div>
<div class="radio-div" v-if="item.radioChildren">
<a-radio-group v-decorator="[item.radioKey]" :disabled="model.inAccount === 1" @change="changeRadioTopic">
<a-radio v-for="item in item.radioChildren" :key="'a_radio_'+ item.value" :value="item.value" :disabled="item.disabled">{{ item.text }}</a-radio>
</a-radio-group>
</div>
</div>
</a-checkbox-group>
<a-button @click="cancelChoiceTopic">清空会议信息</a-button>
</a-form-item>
</a-col>
</a-row>
<!--个人信息end-->
<!--除开国际研讨会的其他会议的显示-->
<template v-if="meetingType !== '3' ">
<other-meeting-form ref="formother" :selected-company="selectedCompany" :meeting-cost-bool="meetingCostBool"
:is-pack-enterprise="isPackEnterprise"
:identify-type="identifyType" @formData="getFormData"></other-meeting-form>
</template>
<!--国际研讨会参会人与内部企业的显示 默认不展示 -->
<template v-if="meetingType === '3' && identifyType !== 1 && identifyType !== null ">
<other-meeting-form ref="formother" :meeting-type="meetingType" :selected-company="selectedCompany" :meeting-cost-bool="meetingCostBool"
:is-pack-enterprise="isPackEnterprise"
:identify-type="identifyType" @formData="getFormData"></other-meeting-form>
</template>
<!-- 国际研讨会身份选择嘉宾 并且是VIP-->
<template v-if="identifyType === 1 && guestType === 1">
<seminar-vip-form ref="seminarVipForm" @formData="getFormData" :identify-type="identifyType" :guest-type="guestType"></seminar-vip-form>
</template>
<!-- 国际研讨会身份选择嘉宾 并且是演讲嘉宾-->
<template v-if="identifyType === 1 && guestType === 2">
<seminar-vip-form ref="seminarVipForm" @formData="getFormData" :guest-type="guestType"></seminar-vip-form>
</template>
<!-- 国际研讨会身份选择嘉宾 并且是特邀嘉宾-->
<template v-if="identifyType === 1 && guestType === 3">
<seminar-vip-form ref="seminarVipForm" @formData="getFormData" :guest-type="guestType"></seminar-vip-form>
</template>
<!-- 国际研讨会身份选择嘉宾 并且是合作伙伴或者是参展商类别-->
<template v-if="identifyType === 1 && (guestType === 4 || guestType === 5)">
<seminar-partner-form ref="seminarPartnerForm" @formData="getFormData"></seminar-partner-form>
</template>
<div class="item-title">其他信息</div>
<a-row :gutter="24">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="备注" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
<a-textarea
placeholder="请输入备注"
:auto-size="{ minRows: 3, maxRows: 6 }"
v-decorator="['remark']"
:maxLength='200'
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
</a-form-item>
</a-col>
</a-row>
<div class="center">
<a-button class="submit" type="primary" @click="handleOk" v-preventclick>确定</a-button>
<a-button @click="handleCancel">取消</a-button>
</div>
</a-form>
<!-- 海外会议单独的表单 -->
<a-form :form="form" v-else>
<!-- 海外会议的表单 -->
<div class="item-title">个人信息</div>
<a-row :gutter="24">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload v-decorator="['photo',overseasRules.photo]" :return-id="true"></j-image-upload>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入姓名"
:maxLength='50'
v-decorator="['name',overseasRules.name]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="职务及单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入职务及单位"
:maxLength='50'
v-decorator="['unit',overseasRules.unit]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="国际" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入国际"
:maxLength='50'
v-decorator="['international',overseasRules.international]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入地址"
:maxLength='50'
v-decorator="['address',overseasRules.address]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入邮箱"
:maxLength='50'
v-decorator="['email',overseasRules.email]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入联系电话"
:maxLength='50'
v-decorator="['phone',overseasRules.phone]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="是否需要签证" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-decorator="['needVisa',overseasRules.needVisa]"
:triggerChange="true"
placeholder="请选择是否需要签证"
@change="changeNeedVisa"
type="radio"
dictCode="yn"/>
</a-form-item>
</a-col>
<template v-if="isNeedVisa">
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="外文姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入外文姓名"
:maxLength='50'
v-decorator="['foreignName',overseasRules.foreignName]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入性别"
:maxLength='50'
v-decorator="['sex',overseasRules.sex]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="出生日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择出生日期" style="width: 100%;"
v-decorator="['birthday',overseasRules.birthday]"
:trigger-change="true"
show-type="day"
date-format="YYYY-MM-DD"/>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="国籍" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入国籍"
:maxLength='50'
v-decorator="['nationality',overseasRules.nationality]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="护照号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入护照号码"
:maxLength='50'
v-decorator="['passportNo',overseasRules.passportNo]"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="出入境日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请输入出入境日期" style="width: 100%;"
v-decorator="['entryAndExitDate',overseasRules.entryAndExitDate]"
:trigger-change="true"
show-type="day"
date-format="YYYY-MM-DD"/>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="12" :sm="24">
<a-form-item label="办理签证使领馆" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入办理签证使领馆"
:maxLength='50'
v-decorator="['embassiesAndConsulates',overseasRules.embassiesAndConsulates]"></a-input>
</a-form-item>
</a-col>
</template>
</a-row>
<div class="center">
<a-button class="submit" type="primary" @click="handleOk" v-preventclick>确定</a-button>
<a-button @click="handleCancel">取消</a-button>
</div>
</a-form>
</a-spin>
</a-card>
</div>
</template>
<script>
import SelectContacts from '@comp/company/SelectContacts'
import OtherMeetingForm from '@views/incomePayments/meetManage/OtherMeetingForm'
import SeminarVipForm from '@views/incomePayments/meetManage/modules/SeminarVipForm'
import SeminarPartnerForm from '@views/incomePayments/meetManage/modules/SeminarPartnerForm'
import AddMeetingCompany from '@comp/company/AddMeetingCompany'
import {getContactsById} from '@api/api'
import {getSingUpUserInfo, validateStandard, getMeetInfoById, getLinkTopics} from '@api/incomeMeetingApi'
import {judgeCompanyIsPackaged, judgeInternalEnterprise} from '../../../api/incomePaymentsApi'
import {httpAction} from '@api/manage'
import pick from 'lodash.pick'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import { queryCompanyInfoById } from '../../../api/api'
import {LinkTopicsEnums, MeetingTypeEnums, YesOrNoEnums} from '../../../enums/commonEnums'
import WasicTopicData from './modules/wasicStaticData'
import JImageUpload from '@comp/jero/JImageUpload'
import JDate from '@comp/tools/JDate'
export default {
name: 'SignUpInfoEdit',
components: {
JDate,
JImageUpload,
SelectContacts,
SeminarPartnerForm,
// JDictSelectTag,
OtherMeetingForm,
SeminarVipForm,
AddMeetingCompany,
PageHeaderTitle
},
data() {
return {
MeetingTypeEnums,
description: '报名信息编辑页',
form: this.$form.createForm(this),
confirmLoading: false,
selectedCompany: null,
model: {},
formData:{},
labelCol: {
xs: {span: 24},
sm: {span: 6}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 18}
},
remarksLabelCol: {
xs: {span: 24},
sm: {span: 3}
},
remarksWrapperCol: {
xs: {span: 24},
sm: {span: 21}
},
validatorRules: {
companyId: {
rules: [{required: true, message: '请选择参会企业'}],
validateTrigger: 'change'
},
companyContactId: {
rules: [{required: true, message: '请选择参会人'}],
validateTrigger: 'change'
},
phone: {
rules: [{required: true, message: '请输入手机号'}],
validateTrigger: 'blur'
},
choiceTopic: {
rules: [
{required: true, validator: this.checkChoiceTopic},
],
validateTrigger: ['change']
},
identify: {
rules: [{required: true, message: '请选择身份'}],
validateTrigger: 'change'
},
guestType:{
rules: [{required: true, message: '请选择嘉宾类型'}],
validateTrigger: 'change'
},
post: {
rules: [{required: true, message: '请输入职务'}],
validateTrigger: 'blur'
}
},
// 身份类型
identifyType: null,
// 嘉宾类型
guestType: null,
// 姓名的回显
selectPerson:null,
// 会议类型
meetingType: '',
// 当前会议的信息
currentMeetingInfo:{},
// 会议费用是否为0
meetingCostBool:false,
// 是否是标协成员
isStandardBool: false,
// url:{
// add:'/meeting/payMeetingSituation/add',
// edit:'/meeting/payMeetingSituation/edit'
// },
// 其他会议的url
otherMeetingUrl: {
add: '/meeting/ohterMeetingSituation/add',
edit:'/meeting/ohterMeetingSituation/edit'
},
// 分标委会议的url
committeeMeetingUrl: {
add: '/meeting/committeeMeetingSituation/add',
edit:'/meeting/committeeMeetingSituation/edit'
},
// 国际研讨会的url
internalMeetingUrl: {
add: '/meeting/internalMeetingSituation/add',
edit:'/meeting/internalMeetingSituation/edit'
},
// 标协会议的url
standardsMeetingUrl: {
add: '/meeting/standardsMeetingSituation/add',
edit:'/meeting/standardsMeetingSituation/edit'
},
// 工作组会议的url
workGroupMeetingUrl: {
add: '/meeting/workGroupMeetingSituation/add',
edit:'/meeting/workGroupMeetingSituation/edit'
},
// 理事会会议
councilMeetingUrl:{
add: '/meeting/councilMeetingSituation/add',
edit:'/meeting/councilMeetingSituation/edit'
},
// 起草组会议的url
draftGroupMeetingUrl: {
add: '/meeting/draftGroupMeetingSituation/add',
edit:'/meeting/draftGroupMeetingSituation/edit'
},
// 海外会议的url
overseasMeetingUrl: {
add: '',
edit: ''
},
title:'添加参会人',
// 当前参会企业是否是内部企业
isInternalEnterprise: false,
// 当前参会企业是否是打包企业
isPackEnterprise: false,
// 可选会议名称的数组
linkTopicsOptionArr: [],
// WASIC可选会议的数组-前端写死
showTopicsArr: [...WasicTopicData],
/*海外会议start*/
// 是否需要签证
isNeedVisa: false,
// 海外会议表单校验
overseasRules: {
photo: {
rules: [{required: true, message: '请上传照片'}],
validateTrigger: 'change'
},
name: {
rules: [{required: true, message: '请输入姓名'}],
validateTrigger: 'blur'
},
unit: {
rules: [{required: true, message: '请输入职务及单位'}],
validateTrigger: 'blur'
},
international: {
rules: [{required: true, message: '请输入国际'}],
validateTrigger: 'blur'
},
address: {
rules: [{required: true, message: '请输入地址'}],
validateTrigger: 'blur'
},
email: {
rules: [{required: true, message: '请输入邮箱'}],
validateTrigger: 'blur'
},
phone: {
rules: [{required: true, message: '请输入联系电话'}],
validateTrigger: 'blur'
},
needVisa: {
rules: [{required: true, message: '请选择是否需要签证'}],
validateTrigger: 'change'
},
foreignName: {
rules: [{required: true, message: '请输入外文姓名'}],
validateTrigger: 'blur'
},
sex: {
rules: [{required: true, message: '请输入性别'}],
validateTrigger: 'blur'
},
birthday: {
rules: [{required: true, message: '请输入选择日期'}],
validateTrigger: 'change'
},
nationality: {
rules: [{required: true, message: '请输入国籍'}],
validateTrigger: 'blur'
},
passportNo: {
rules: [{required: true, message: '请输入护照号码'}],
validateTrigger: 'blur'
},
entryAndExitDate: {
rules: [{required: true, message: '请选择出入境日期'}],
validateTrigger: 'change'
},
embassiesAndConsulates: {
rules: [{required: true, message: '请输入办理签证使领馆'}],
validateTrigger: 'blur'
},
}
/*海外会议end*/
}
},
created() {
this.meetingType = this.$route.query.meetingType
// 参会情况页面判断的是否会议费用为0 true 为0
if(this.$route.query.costBool === 'true'){
this.meetingCostBool = true
}else if(this.$route.query.costBool === 'false'){
this.meetingCostBool = false
}
if(this.$route.query.id){
// 通过id获取参会人信息
getSingUpUserInfo({id:this.$route.query.id}).then(res => {
if(res.success){
this.edit(res.result)
}
})
}
//获取 会议信息
if(this.$route.query.meetingId){
this.queryMeetingInfo(this.$route.query.meetingId)
}
},
computed:{
// 是否海外会议,报名信息调整
isOverseasMeeting () {
return this.meetingType + '' === MeetingTypeEnums.overseas.value
},
// eslint-disable-next-line
url() {
switch (this.$route.query.meetingType) {
case '1':
return this.workGroupMeetingUrl
case '2':
return this.standardsMeetingUrl
case '3':
return this.internalMeetingUrl
case '4':
return this.otherMeetingUrl
case '5':
return this.committeeMeetingUrl
case '6':
return this.councilMeetingUrl
case '7':
return this.draftGroupMeetingUrl
// 海外会议
case MeetingTypeEnums.overseas.value:
return this.overseasMeetingUrl
}
},
},
methods: {
// 是否需要签证改变
changeNeedVisa (val) {
if (val + '' === YesOrNoEnums.no.value) {
this.isNeedVisa = true
} else {
this.isNeedVisa = false
}
},
// 验证选择会议名称的情况
checkChoiceTopic(rules, value, callback) {
console.log(value)
let arr = []
if (value && value.length > 0) {
arr = [...value]
}
let radioKey = this.form.getFieldValue('radioKey')
let radioKeyTwo = this.form.getFieldValue('radioKeyTwo')
if(radioKey || radioKeyTwo) {
callback()
} else {
arr = arr.filter(tt => tt !== LinkTopicsEnums.freeTwo.index + '')
if(arr.length === 0) {
callback('请至少选择一个非参观类会议')
} else {
callback()
}
}
},
choiceTopicChange(e) {
console.log(e)
},
changeRadioTopic() {
this.$nextTick(() => {
this.form.validateFields(['choiceTopic'])
})
},
// 取消会议名称的选中
cancelChoiceTopic() {
this.form.setFieldsValue({
choiceTopic: [],
radioKey: undefined,
radioKeyTwo: undefined,
})
},
// 获取国际研讨会-能选择课题的数据字典数据
getLinkTopicsOptionArr(meetingId) {
getLinkTopics({id: meetingId}).then(res =>{
if(res.success) {
this.linkTopicsOptionArr = res.result || []
// 页面上展示的文字 按照数据字段返回的展示
this.showTopicsArr.map(tt => {
tt.children.map(item => {
let ele = this.linkTopicsOptionArr.find(a => a.value + '' === item.value)
if(ele) {
item.text = ele.text
item.title = ele.title
}
})
tt.radioChildren && tt.radioChildren.map(item => {
let ele = this.linkTopicsOptionArr.find(a => a.value + '' === item.value)
if(ele) {
item.text = ele.text
item.title = ele.title
}
})
})
// 操作默认的课题,默认的课题不能删除
// this.linkTopicsOptionArr.map(item => {
// if((item.value + '') === (LinkTopicsEnums.default.index + '')) {
// item.disabled = true
// }
// })
// 新增页面,给Form赋值
if(!this.model.id) {
this.form.setFieldsValue({
choiceTopic: []
})
}
}
})
},
// 通过企业的id获取企业管理中的基本信息,用于发票回显
queryCompanyInfoById(id) {
return new Promise(resolve => {
let result = {}
queryCompanyInfoById({id}).then(res => {
if(res.success) {
result = res.result || {}
result = pick(res.result, 'companyName', 'dutyCode', 'companyAddress', 'companyPhone', 'openingBank', 'bankAccount', 'linkBankNumber')
}
}).finally(() => {
resolve(result)
})
})
},
addContactsOk() {
this.$refs.selectContacts.getContactsList()
},
/*
* 编辑
* */
async edit(record){
this.isInternalEnterprise = false
this.form.resetFields()
this.model = Object.assign({},record)
if(this.model.id){
this.title = '编辑参会人'
}
// 海外会议回显单独处理
if (this.isOverseasMeeting) {
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
return
}
// 设置编辑的显示隐藏状态
this.identifyType = this.model.identity
this.guestType = this.model.guestType ? this.model.guestType : null
// 判断当前企业是否是打包企业
this.judgeCompanyIsPackaged(this.model.companyId, false)
// 参会单位回显
this.model.companyId = {
id:this.model.companyId,
companyName:this.model.companyName,
}
// 参会人回显
// this.selectedCompany = this.model.companyId
// 如果当前的参会人信息中发票信息不全 则从企业管理中获取一下
// if(!this.model.dutyCode && !this.model.companyAddress)
// 从企业管理中获取全部的会议信息
let companyInfo = await this.queryCompanyInfoById(this.model.companyId.id)
// 判断当前数据中企业信息是否完整 将有数据的赋值到数据中
// 写入发票的信息,因为需要回显
// dutyCode:this.model.dutyCode, // 信用代码
// companyAddress:this.model.companyAddress, // 公司地址
// companyPhone:this.model.companyPhone, // 公司电话
// openingBank:this.model.openingBank, // 开户行
// bankAccount:this.model.bankAccount, // 银行账号
// linkBankNumber:this.model.linkBankNumber // 联行号
let invoiceKeys = ['dutyCode', 'companyAddress', 'companyPhone', 'openingBank', 'bankAccount', 'linkBankNumber']
let invoiceInfo = {}
invoiceKeys.map(key => {
if(this.model[key]) {
invoiceInfo[key] = this.model[key]
}
})
this.selectedCompany = Object.assign({}, companyInfo, this.model.companyId, invoiceInfo)
this.selectPerson = {
id:this.model.companyContactTemporaryId,
name:this.model.companyContactName
}
// 如果存在所选择的课题,则对课题数据进行处理
if (this.model.choiceTopic) {
let choiceTopicArr = this.model.choiceTopic.split(',')
this.showTopicsArr = JSON.parse(JSON.stringify(WasicTopicData))
let checkboxArr = [], radioObj = {}
choiceTopicArr.map(checkedItem => {
this.showTopicsArr.map(tt => {
let index = tt.children.findIndex(inner => inner.value === checkedItem)
if(index > -1) {
tt.children[index].checked = true
checkboxArr.push(checkedItem)
}
if(tt.radioChildren) {
let radioIndex = tt.radioChildren.findIndex(inner => inner.value === checkedItem)
if(radioIndex > -1) {
tt.radioChildren[radioIndex].checked = true
radioObj[tt.radioKey] = checkedItem
}
}
})
})
this.form.setFieldsValue({
...radioObj,
'choiceTopic': checkboxArr
})
}
//国际研讨会的嘉宾编辑回显值
this.$nextTick(() => {
// 普通会议的编辑回显值
if(this.$refs.formother){
// 打包不显示行程信息
if(record.payMode === 3){
this.$refs.formother.payModeBool = false
}
// 缴费方式为汇款 需要显示发票字段
if(record.payMode === 1){
this.$refs.formother.payModeBool = false
}
// 缴费方式为线上的需要回显订单号后四位
if(record.payMode === 2){
this.$refs.formother.onlinePayModeBool = true
// 控制发票是否显示的字段
this.$refs.formother.payModeBool = false
}
this.$refs.formother.setFormVal(this.model)
}
//国际研讨会的嘉宾前三个的编辑回显值
if(this.$refs.seminarVipForm){
this.$refs.seminarVipForm.setFormVal(this.model)
}
// 国际研讨会合作伙伴的回显
if(this.$refs.seminarPartnerForm){
this.$refs.seminarPartnerForm.setFormVal(this.model)
}
this.form.setFieldsValue(pick(this.model,
'companyId',
'companyContactId',
'phone',
'email',
'post',
'identity',
'guestType',
'remark'
))
})
},
/*
* 确定
* */
handleOk() {
const that = this
// 其他会议的表单验证
if( this.$refs.formother !== undefined ){
this.$refs.formother.handleOk()
}
// 国际研讨会 VIP 演讲嘉宾 特邀嘉宾 的表单验证
if( this.$refs.seminarVipForm !== undefined ){
this.$refs.seminarVipForm.handleOk()
}
// 国际研讨会的合作伙伴的表单验证
if( this.$refs.seminarPartnerForm !== undefined ){
this.$refs.seminarPartnerForm.handleOk()
}
if(this.formData.stop){
return
}
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
let submitData = Object.assign({},values,this.formData)
// 去掉所有的未审核字段,有中文的 有英文的
if(submitData.companyName) {
submitData.companyName = (submitData.companyName || '').replaceAll(' (未审核)','').replaceAll(' (未审核)','')
}
if (values.companyId) {
submitData.companyId = values.companyId.id
}
// 会议id
submitData.meetingId = this.$route.query.meetingId
// 会议类型
submitData.meetingType = this.$route.query.meetingType
// 会议费用为 0 设置参数 需要发票为0
if(this.meetingCostBool){
submitData.needInvoice = 0
}
// 国际研讨会处理 会议名称的问题
// 国际研讨会 且为WASIC 会议
if (this.currentMeetingInfo.meetingType === '3' && this.currentMeetingInfo.isWasic) {
let choiceTopicArr = submitData.choiceTopic
//11月27日 单选会议的处理
if(submitData.radioKey) {
choiceTopicArr.push(submitData.radioKey)
delete submitData.radioKey
}
//11月28日 单选会议的处理
if(submitData.radioKeyTwo) {
choiceTopicArr.push(submitData.radioKeyTwo)
delete submitData.radioKeyTwo
}
submitData.choiceTopic = choiceTopicArr.join(',')
}
console.log(submitData)
let url = ''
if(!this.model.id){
url = this.url.add
}else {
url = this.url.edit
// 编辑的时候需要传入id
submitData.id = this.model.id
}
// that.confirmLoading = false
// return
let method = 'post'
httpAction(url,submitData,method).then(res => {
if(res.success){
that.$emit('ok')
that.handleCancel()
that.$message.success(res.message)
that.confirmLoading = false
}else {
that.$message.warn(res.message)
}
}).finally( () => {
that.confirmLoading = false
})
}
})
},
/*
* 获取表单的值
* */
getFormData(value){
this.formData = Object.assign({},value)
},
/*
* 取消
* */
handleCancel() {
this.$router.go(-1)
},
/*
* 改变身份
* */
changeIdentify(e) {
this.identifyType = e.target.value
// 切换身份清除上次选择的值
if (e.target.value !== 1) {
this.guestType = null
}
this.$nextTick( ()=> {
this.$refs.formother.setFormVal(Object.assign({}, this.model, { identify: this.identifyType}))
})
},
/*
* 选择嘉宾类型
* */
changeGuestType(e) {
this.guestType = e.target.value
},
/*
* 选择参会企业
* */
changeCompany(value, otherParams) {
// this.selectedCompany = value
this.selectedCompany = otherParams
// 去掉未审核 去判断的企业是否是标协会企业
let companyName = this.selectedCompany.companyName.replaceAll('(未审核)','')
// 通过企业名称判断当前会议费用 是否为 0
if (this.currentMeetingInfo.meetingType + '' === '2') {
validateStandard({companyName: companyName}).then(res => {
this.isStandardBool = res.result
this.meetingCostBool = false
if (this.isStandardBool) {
// 是标协企业 判断 会员费用是否为0
if(this.currentMeetingInfo.meetingCostsVip === '0.00'){
this.meetingCostBool = true
}
}else {
// 不是标协企业 判断正常会议费用 是否为 0
if( this.currentMeetingInfo.meetingCosts === '0.00'){
this.meetingCostBool = true
}
}
if( this.$refs.formother !== undefined ){
console.log( this.$refs.formother.meetingCostBool,' this.$refs.formother.meetingCostBool')
}
})
}
// 选择企业清空 姓名 手机号
this.form.resetFields(['companyContactId','phone'])
if(this.$refs.formother ){
this.$refs.formother.clearFormItem()
// 设置发票的相关信息
this.$refs.formother.setInvoiceFormItem()
}
// 判断当前企业是否是内部企业
console.log('-----this.selectedCompany-----', this.selectedCompany)
this.judgeInternalEnterprise(this.selectedCompany.id)
// 判断当前企业是否是打包企业
this.judgeCompanyIsPackaged(this.selectedCompany.id)
},
/**
* 判断当前的企业是否是打包企业,如果是修改isPackEnterprise
*/
judgeCompanyIsPackaged (id, clearForm = true) {
judgeCompanyIsPackaged({ companyId: id }).then(res => {
if (res.success) {
this.isPackEnterprise = res.result
}
}).finally(() => {
// 清空已选的缴费方式
if (clearForm && this.$refs.formother) {
this.$refs.formother.clearPayMode()
}
})
},
/*
* 选择联系人获取信息
* */
changeContact(val) {
const that = this
getContactsById({id: val}).then(res => {
const model = Object.assign({}, res.result)
// 设置手机 邮箱 职务
if (res.success) {
that.form.setFieldsValue(pick(model, 'phone', 'email', 'post'))
}
// 设置邮寄联系人和地址
if(this.$refs.formother !== undefined){
this.$refs.formother.setAddressVal(res.result)
}
})
},
/*
* 判断当前的企业是否是内部企业,如果是修改isInternalEnterprise
* */
judgeInternalEnterprise(id, clearForm = true) {
let params = {
id: id
}
judgeInternalEnterprise(params).then(res => {
if(res.success) {
this.isInternalEnterprise = res.result !== 'false'
}
}).finally(() => {
if (clearForm) {
// 清空form表单身份的数据
this.form.setFieldsValue({
identity: null
})
// 嘉宾类型置空
this.guestType = null
}
})
},
/**
* @Description 通过会议id获取会议信息
* @Date 2021-11-29
* @param meetingId 会议id
* @author fac
* */
queryMeetingInfo(meetingId){
this.currentMeetingInfo = {}
getMeetInfoById({id: meetingId}).then(res => {
if(res.success){
this.currentMeetingInfo = res.result
// 国际研讨会 且为WASIC 会议
if (this.currentMeetingInfo.meetingType === '3' && this.currentMeetingInfo.isWasic){
this.getLinkTopicsOptionArr(meetingId)
}
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.center {
text-align: center;
.submit {
margin-right: 8px;
}
}
.item-title {
padding-left: 40px;
box-sizing: border-box;
height: 46px;
line-height: 46px;
color: #333;
position: relative;
font-size: 16px;
&::before {
position: absolute;
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background: #069f99;
top: 50%;
margin-top: -5px;
left: 15px;
}
}
// 国际研讨会-关联会议 多选样式的修改
.meeting-form-multi-select{
.topic-title{
padding: 10px 0;
}
/deep/.ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin-left: 0!important;
}
/deep/ .ant-checkbox-wrapper,
/deep/ .ant-radio-wrapper{
margin-right: 8px;
display: block;
}
}
.radio-div{
border-top: 1px solid rgba(0, 0, 0, 0.2);
padding-top: 10px;
margin-top: 10px;
}
</style>