【update】 发票信息页面功能的增加、报名页面增加编辑、删除功能
This commit is contained in:
+166
-53
@@ -9,12 +9,9 @@ import {
|
||||
compareDate,
|
||||
dutyCode
|
||||
} from '../../utils/validate'
|
||||
|
||||
const InvoiceTypeEnums = {
|
||||
noNeed: { name: '不需要', index: 0 },
|
||||
plain: { name: '增值税普通发票', index: 1 },
|
||||
special: { name: '增值税专用发票', index: 2 }
|
||||
}
|
||||
import {
|
||||
InvoiceTypeEnums
|
||||
} from '../../assets/js/Enums/common.js'
|
||||
|
||||
Page({
|
||||
behaviors: [confirmInvoiceModalBehavior],
|
||||
@@ -118,7 +115,9 @@ Page({
|
||||
// 扫码报名的 需要调用无限制接口
|
||||
nolimitBool: false,
|
||||
// 会议费用
|
||||
meetingCost: ''
|
||||
meetingCost: '',
|
||||
// 备注信息
|
||||
remark: '',
|
||||
},
|
||||
// 是否需要发票的选择
|
||||
needInvoiceChange(e) {
|
||||
@@ -193,7 +192,6 @@ Page({
|
||||
this.setData({
|
||||
selectedIdentity: e.detail.value
|
||||
})
|
||||
console.log(e.detail.value);
|
||||
// 参会身份选择嘉宾和内部企业 会议费用为 0
|
||||
if (e.detail.value === '2') {
|
||||
// 标协会议需要判断选中的企业是否是标协成员
|
||||
@@ -375,7 +373,7 @@ Page({
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!formData.invoiceProject || formData.invoiceProject === -1) {
|
||||
if (formData.invoiceProject === undefined || formData.invoiceProject === -1) {
|
||||
wx.showToast({
|
||||
title: '请选择发票项目',
|
||||
icon: 'none',
|
||||
@@ -431,11 +429,22 @@ Page({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
signUpApi.signUpMeeting(formData).then(res => {
|
||||
let func
|
||||
let lastPage // 上一个调换的页面,用于记录编辑成功后返回哪个页面
|
||||
const isEdit = this.isEdit
|
||||
if(isEdit) {
|
||||
func = MeetingApi.editContactsInfo
|
||||
formData.id = this.model.id // 编辑参会人的信息
|
||||
lastPage = this.lastPage
|
||||
} else {
|
||||
func = signUpApi.signUpMeeting
|
||||
}
|
||||
func(formData).then(res => {
|
||||
if (res.success) {
|
||||
wx.hideLoading({})
|
||||
let message = isEdit ? '编辑成功' : '报名成功'
|
||||
wx.showToast({
|
||||
title: '报名成功',
|
||||
title: message,
|
||||
icon: 'loading',
|
||||
duration: 1500
|
||||
})
|
||||
@@ -449,15 +458,22 @@ Page({
|
||||
wx.removeStorage({
|
||||
key: 'currentMeetingInfo',
|
||||
success() {
|
||||
// 跳转报名成功页面
|
||||
|
||||
if (!res.result) {
|
||||
wx.navigateTo({
|
||||
url: `../signUpSuccess/signUpSuccess?audit=${res.result}`,
|
||||
})
|
||||
// 非编辑页面跳转到下一页
|
||||
if(!isEdit) {
|
||||
// 跳转报名成功页面
|
||||
if (!res.result) {
|
||||
wx.navigateTo({
|
||||
url: `../signUpSuccess/signUpSuccess?audit=${res.result}`,
|
||||
})
|
||||
} else {
|
||||
wx.navigateTo({
|
||||
url: `../signUpSuccess/signUpSuccess`,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 编辑页面跳转到会议列表页
|
||||
wx.navigateTo({
|
||||
url: `../signUpSuccess/signUpSuccess`,
|
||||
url: lastPage,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -504,7 +520,6 @@ Page({
|
||||
if (flag) {
|
||||
return
|
||||
}
|
||||
console.log('选择参会单位', this.data.nolimitBool);
|
||||
if (this.data.nolimitBool) {
|
||||
wx.navigateTo({
|
||||
url: `../companyList/companyList?nolimit=nolimt`,
|
||||
@@ -532,7 +547,6 @@ Page({
|
||||
},
|
||||
// 信用代码验证
|
||||
validateDutyCode(e) {
|
||||
console.log(e, 1111)
|
||||
let value = e.detail.value
|
||||
let {
|
||||
message,
|
||||
@@ -565,7 +579,6 @@ Page({
|
||||
},
|
||||
// 发票项目变化的时候触发的方法
|
||||
invoiceProjectChange(e) {
|
||||
console.log("------e--------", e)
|
||||
this.setData({
|
||||
invoiceProjectIndex: e.detail.value
|
||||
})
|
||||
@@ -575,12 +588,15 @@ Page({
|
||||
MeetingApi.meetingDetail({
|
||||
id: id
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.success) {
|
||||
this.setData({
|
||||
selectedMeeting: res.result,
|
||||
meetingCost: res.result.meetingCosts
|
||||
})
|
||||
// 编辑的时候判断是否是标协会员,费用是否需要修改
|
||||
if(this.isEdit) {
|
||||
this.judgeMemberCompany(this, res.result)
|
||||
}
|
||||
// 存储会议信息
|
||||
wx.setStorage({
|
||||
key: 'currentMeetingInfo',
|
||||
@@ -595,10 +611,80 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
/*
|
||||
* 编辑
|
||||
* */
|
||||
edit(record){
|
||||
this.model = Object.assign({}, record)
|
||||
// 选中的身份
|
||||
const selectedIdentity = this.model.identity + ''
|
||||
// 参会身份选中状态的处理
|
||||
this.data.identifyList.map(tt => {
|
||||
if (tt.value === selectedIdentity) {
|
||||
tt.checked = true
|
||||
}
|
||||
})
|
||||
// 是否选择发票的选中的索引 默认需要
|
||||
const index = this.data.needInvoiceList.findIndex(e => e.value === (this.model.needInvoice + '')) + ''
|
||||
// 缴费方式
|
||||
const paymentMethod = this.model.payMode
|
||||
// 缴费方式选中状态的处理
|
||||
this.data.paymentMethodList.map(tt => {
|
||||
if (tt.value === paymentMethod + '') {
|
||||
tt.checked = true
|
||||
}
|
||||
})
|
||||
// 选中的参会单位
|
||||
const selectedCompany = {
|
||||
id:this.model.companyId,
|
||||
companyName:this.model.companyName,
|
||||
// 写入发票的信息,因为需要回显
|
||||
dutyCode:this.model.dutyCode, // 信用代码
|
||||
companyAddress:this.model.companyAddress, // 公司地址
|
||||
companyPhone:this.model.companyPhone, // 公司电话
|
||||
openingBank:this.model.openingBank, // 开户行
|
||||
bankAccount:this.model.bankAccount, // 银行账号
|
||||
linkBankNumber:this.model.linkBankNumber // 联行号
|
||||
}
|
||||
const selectedPerson = {
|
||||
id:this.model.companyContactTemporaryId,
|
||||
name:this.model.companyContactName
|
||||
}
|
||||
// 发票项目选择的索引
|
||||
const invoiceProjectIndex = this.data.invoiceProjectList.findIndex(e => e.value === (this.model.invoiceProject + ''))
|
||||
// 回显邮寄联系人
|
||||
const selectedPostPerson = {
|
||||
id: this.model.postContactId,
|
||||
name: this.model.postContactName,
|
||||
contactAddress: this.model.postContactAddress, // 邮寄地址
|
||||
postalCode: this.model.postCode, // 邮编
|
||||
}
|
||||
|
||||
this.setData({
|
||||
selectedCompany,
|
||||
selectedPerson,
|
||||
phone: this.model.phone,
|
||||
selectedIdentity, // 参会身份
|
||||
identifyList: this.data.identifyList, // 参会身份选中
|
||||
paymentMethod, // 缴费方式
|
||||
paymentMethodList: this.data.paymentMethodList, // 缴费方式信息选中
|
||||
index, // 是否需要发票
|
||||
invoiceProjectIndex, // 发票项目
|
||||
selectedPostPerson, // 邮寄联系人信息
|
||||
remark: this.model.remark // 备注
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
onLoad: async function (options) {
|
||||
// options = {
|
||||
// id: "1682018325751480322",
|
||||
// meetingId: "1680850121742204930",
|
||||
// meetingType: 1,
|
||||
// page: 'meeting',
|
||||
// ope: 'edit'
|
||||
// }
|
||||
if (options.type) {
|
||||
this.setData({
|
||||
indexMsg: options.type,
|
||||
@@ -609,10 +695,33 @@ Page({
|
||||
nolimitBool: true
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
pageTitle: options.id ? '编辑报名信息' : '会议报名'
|
||||
})
|
||||
if(options.id){
|
||||
this.isEdit = options.ope === 'edit'
|
||||
this.lastPage = `../${options.page}/${options.page}`
|
||||
// 对上一个页面的参数进行处理
|
||||
this.lastOptions = options.options && JSON.parse(options.options) || {}
|
||||
let str = ''
|
||||
Object.keys(this.lastOptions).forEach((tt, i) => {
|
||||
if( i > 0) {
|
||||
str += `&${tt}=${this.lastOptions[tt]}`
|
||||
} else {
|
||||
str += `?${tt}=${this.lastOptions[tt]}`
|
||||
}
|
||||
})
|
||||
this.lastPage += str
|
||||
// 通过id获取参会人信息
|
||||
MeetingApi.queryPersongInfoById({id: options.id}).then(res => {
|
||||
if(res.success){
|
||||
this.edit(res.result)
|
||||
}
|
||||
})
|
||||
}
|
||||
// this.queryMeetingInfo('1455359606691979265')
|
||||
if (options.meetingId) {
|
||||
console.log(options.meetingId, 'options.meetingId');
|
||||
this.queryMeetingInfo(options.meetingId)
|
||||
await this.queryMeetingInfo(options.meetingId)
|
||||
this.setData({
|
||||
meetingId: options.meetingId
|
||||
})
|
||||
@@ -634,7 +743,6 @@ Page({
|
||||
wx.getStorage({
|
||||
key: 'userInfo',
|
||||
success(res) {
|
||||
console.log(res);
|
||||
that.setData({
|
||||
'selectedCompany.companyName': res.data.companyName,
|
||||
'selectedPerson.name': res.data.name,
|
||||
@@ -653,7 +761,6 @@ Page({
|
||||
},
|
||||
// 手机号验证
|
||||
validatePhone(e) {
|
||||
console.log(e);
|
||||
let value = e.detail.value
|
||||
let {
|
||||
message,
|
||||
@@ -720,7 +827,37 @@ Page({
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 判断是否是标协会员的单位 进行费用的重置
|
||||
* @param that--原方法里面就是this实例
|
||||
* @param meetingObj -- 原方法是获取的currentMeetingInfo信息
|
||||
*/
|
||||
judgeMemberCompany(that, meetingObj) {
|
||||
// 标协会议需要判断单位是否是会员单位
|
||||
if (that.data.selectedCompany.companyName && meetingObj.meetingType + '' === '2') {
|
||||
signUpApi.validateStandard({
|
||||
companyName: that.data.selectedCompany.companyName
|
||||
}).then(result => {
|
||||
if (result.result) {
|
||||
that.setData({
|
||||
meetingCost: meetingObj.meetingCostsVip
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
meetingCost: meetingObj.meetingCosts
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
if (that.data.selectedIdentity) {
|
||||
that.changeIdentity({
|
||||
detail: {
|
||||
value: that.data.selectedIdentity
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
@@ -742,7 +879,6 @@ Page({
|
||||
wx.getStorage({
|
||||
key: 'userInfo',
|
||||
success(res) {
|
||||
console.log(res);
|
||||
that.setData({
|
||||
'selectedCompany.companyName': res.data.companyName,
|
||||
'selectedPerson.name': res.data.name,
|
||||
@@ -791,30 +927,7 @@ Page({
|
||||
that.setData({
|
||||
selectedMeeting: res.data
|
||||
})
|
||||
// 标协会议需要判断单位是否是会员单位
|
||||
if (that.data.selectedCompany.companyName && res.data.meetingType + '' === '2') {
|
||||
signUpApi.validateStandard({
|
||||
companyName: that.data.selectedCompany.companyName
|
||||
}).then(result => {
|
||||
if (result.result) {
|
||||
that.setData({
|
||||
meetingCost: res.data.meetingCostsVip
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
meetingCost: res.data.meetingCosts
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
if (that.data.selectedIdentity) {
|
||||
that.changeIdentity({
|
||||
detail: {
|
||||
value: that.data.selectedIdentity
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
that.judgeMemberCompany(that, res.data)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "会议报名",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
<!--报名页面-->
|
||||
<!--发票信息 自定义头部start -->
|
||||
<view class="custom flex_center" style="padding-top:{{statusBarHeight}}px">
|
||||
<image src="../../assets/images/back.png" bindtap="goBack"></image>
|
||||
<text>{{pageTitle}}</text>
|
||||
</view>
|
||||
<view class="empty_custom" style="padding-top:{{statusBarHeight}}px"></view><!-- 空view用来填充自定义头部的padding-top -->
|
||||
<!-- 自定义头部end -->
|
||||
|
||||
<view class="color-f5 wrap">
|
||||
<form bindsubmit="formSubmit">
|
||||
<view class="form-wrap">
|
||||
@@ -25,7 +33,7 @@
|
||||
<view>
|
||||
<radio-group name='identity' bindchange="changeIdentity">
|
||||
<label class="radio radio-item" wx:for="{{identifyList}}" wx:key="item">
|
||||
<radio wx:if="{{!item.disabled}}" class="radio-scale" value="{{item.value}}" color="#069F99" disabled="{{item.disabled}}" />
|
||||
<radio wx:if="{{!item.disabled}}" class="radio-scale" value="{{item.value}}" color="#069F99" disabled="{{item.disabled}}" checked="{{item.checked}}"/>
|
||||
<text wx:if="{{!item.disabled}}">{{item.name}}</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
@@ -39,7 +47,7 @@
|
||||
<view>
|
||||
<radio-group name='payMode' bindchange="paymentMethodRadioChange">
|
||||
<label class="radio radio-item" wx:for="{{paymentMethodList}}" wx:key="item" style="font-size:13px">
|
||||
<radio class="radio-scale" value="{{item.value}}" color="#069F99" />{{item.name}}
|
||||
<radio class="radio-scale" value="{{item.value}}" color="#069F99" checked="{{item.checked}}"/>{{item.name}}
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
@@ -112,42 +120,42 @@
|
||||
<text class="item-label flex-1 validate">邮编:</text>
|
||||
<input placeholder-class="text-right" name="postCode" bindblur="validatePostCode" value="{{selectedPostPerson.postalCode}}" data-message='请输入邮编' data-errmsg='请输入正确的邮编' type="number" maxlength="6" placeholder="请输入邮编" />
|
||||
</view>
|
||||
|
||||
<view class="form-item-radio">
|
||||
<!-- 这3个字段感觉国际研讨会才会存在 目前企业端报名的时候不存在 所以先去掉 -->
|
||||
<!-- <view class="form-item-radio">
|
||||
<view class="radio-label">
|
||||
<text class="item-label flex-1">是否住酒店:</text>
|
||||
</view>
|
||||
<view>
|
||||
<radio-group name='checkInHotel' bindchange="paymentMethodRadioChange">
|
||||
<label class="radio radio-item" wx:for="{{needCheckInHotel}}" wx:key="item">
|
||||
<radio class="radio-scale" color="#069F99" value="{{item.value}}" />{{item.name}}
|
||||
<radio class="radio-scale" color="#069F99" value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="form-item">
|
||||
<!-- <view class="form-item">
|
||||
<text class="item-label flex-1">抵达时间:</text>
|
||||
<picker name='arrivalTime' mode="date" value="{{date}}" bindchange="bindDateChangeArriveTime">
|
||||
<view class="picker">
|
||||
{{arrivalTime}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="form-item">
|
||||
<!-- <view class="form-item">
|
||||
<text class="item-label flex-1">离开时间:</text>
|
||||
<picker name='departureTime' mode="date" value="{{date}}" bindchange="bindDateChangeLeaveTime">
|
||||
<view class="picker">
|
||||
{{departureTime}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="form-item-radio">
|
||||
<text class="item-label flex-1">备注:</text>
|
||||
<textarea name="remark" placeholder="请输入备注" name="remark" />
|
||||
<textarea name="remark" placeholder="请输入备注" name="remark" value="{{remark}}"/>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
|
||||
Reference in New Issue
Block a user