【fix-bug74480】 会议报名页面增加查询默认企业的信息
This commit is contained in:
@@ -14,7 +14,9 @@ const MeetingApi = {
|
|||||||
// 删除会议报名信息
|
// 删除会议报名信息
|
||||||
deleteSignUpInfo:(params) => http.get(`${URL_CONFIG}meeting/payMeetingSituation/contactsDelete`, params),
|
deleteSignUpInfo:(params) => http.get(`${URL_CONFIG}meeting/payMeetingSituation/contactsDelete`, params),
|
||||||
// 编辑会议报名信息
|
// 编辑会议报名信息
|
||||||
editContactsInfo:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/contactsEdit`, params)
|
editContactsInfo:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/contactsEdit`, params),
|
||||||
|
//通过企业id查询企业的相关发票信息
|
||||||
|
queryCompanyInfoById:(params) => http.get(`${URL_CONFIG}company/payCompanyManagement/queryById`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MeetingApi
|
export default MeetingApi
|
||||||
|
|||||||
@@ -126,10 +126,9 @@ Page({
|
|||||||
UserApi.wxLogin(params).then(res => {
|
UserApi.wxLogin(params).then(res => {
|
||||||
if (res.success) { // 已经用手机号登录过,此时用微信快捷登录时,把微信的个人信息存进缓存(微信信息在缓存的userInfoTemp)
|
if (res.success) { // 已经用手机号登录过,此时用微信快捷登录时,把微信的个人信息存进缓存(微信信息在缓存的userInfoTemp)
|
||||||
wx.setStorageSync('userInfo', res.result.userInfo)
|
wx.setStorageSync('userInfo', res.result.userInfo)
|
||||||
wx.setStorage({
|
wx.setStorageSync( 'X-Access-Token',
|
||||||
key: 'X-Access-Token',
|
res.result.token
|
||||||
data: res.result.token
|
)
|
||||||
})
|
|
||||||
wx.setStorageSync('authorize', true) // 设置有过微信授权
|
wx.setStorageSync('authorize', true) // 设置有过微信授权
|
||||||
wx.setStorage({
|
wx.setStorage({
|
||||||
key: 'avatarUrl',
|
key: 'avatarUrl',
|
||||||
|
|||||||
@@ -614,7 +614,7 @@ Page({
|
|||||||
/*
|
/*
|
||||||
* 编辑
|
* 编辑
|
||||||
* */
|
* */
|
||||||
edit(record){
|
async edit(record){
|
||||||
this.model = Object.assign({}, record)
|
this.model = Object.assign({}, record)
|
||||||
// 选中的身份
|
// 选中的身份
|
||||||
const selectedIdentity = this.model.identity + ''
|
const selectedIdentity = this.model.identity + ''
|
||||||
@@ -634,18 +634,33 @@ Page({
|
|||||||
tt.checked = true
|
tt.checked = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 通过接口获取全部的企业信息
|
||||||
|
let companyInfo = await this.queryCompanyInfoById(this.model.companyId)
|
||||||
|
// 然后和PC端一样对比字段的值,将没有的初始化复制
|
||||||
|
let invoiceKeys = ['dutyCode', 'companyAddress', 'companyPhone', 'openingBank', 'bankAccount', 'linkBankNumber']
|
||||||
|
let invoiceInfo = {}
|
||||||
|
invoiceKeys.map(key => {
|
||||||
|
if(this.model[key]) {
|
||||||
|
invoiceInfo[key] = this.model[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
// 选中的参会单位
|
// 选中的参会单位
|
||||||
const selectedCompany = {
|
const selectedCompany = Object.assign({}, companyInfo, {
|
||||||
id:this.model.companyId,
|
id: this.model.companyId,
|
||||||
companyName:this.model.companyName,
|
companyName: this.model.companyName,
|
||||||
// 写入发票的信息,因为需要回显
|
}, invoiceInfo)
|
||||||
dutyCode:this.model.dutyCode, // 信用代码
|
|
||||||
companyAddress:this.model.companyAddress, // 公司地址
|
// const selectedCompany = {
|
||||||
companyPhone:this.model.companyPhone, // 公司电话
|
// id:this.model.companyId,
|
||||||
openingBank:this.model.openingBank, // 开户行
|
// companyName:this.model.companyName,
|
||||||
bankAccount:this.model.bankAccount, // 银行账号
|
// // 写入发票的信息,因为需要回显
|
||||||
linkBankNumber:this.model.linkBankNumber // 联行号
|
// 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 = {
|
const selectedPerson = {
|
||||||
id:this.model.companyContactTemporaryId,
|
id:this.model.companyContactTemporaryId,
|
||||||
name:this.model.companyContactName
|
name:this.model.companyContactName
|
||||||
@@ -674,10 +689,24 @@ Page({
|
|||||||
remark: this.model.remark // 备注
|
remark: this.model.remark // 备注
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 通过id获取企业的信息
|
||||||
|
queryCompanyInfoById(id) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
let result = {}
|
||||||
|
MeetingApi.queryCompanyInfoById({id}).then(callRes => {
|
||||||
|
if(callRes.success) {
|
||||||
|
result = callRes.result || {}
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
resolve(result)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: async function (options) {
|
onLoad: async function (options) {
|
||||||
|
console.log(options, "------options-------")
|
||||||
// options = {
|
// options = {
|
||||||
// id: "1682018325751480322",
|
// id: "1682018325751480322",
|
||||||
// meetingId: "1680850121742204930",
|
// meetingId: "1680850121742204930",
|
||||||
@@ -697,7 +726,7 @@ Page({
|
|||||||
}
|
}
|
||||||
// 初始化一些信息和页面上的判断 为了不显示相应的数据
|
// 初始化一些信息和页面上的判断 为了不显示相应的数据
|
||||||
this.setData({
|
this.setData({
|
||||||
selectedIdentity: 0, // 选中的参会身份
|
selectedIdentity: 0, // 选中的参会身份
|
||||||
paymentMethod: 0, // 缴费方式
|
paymentMethod: 0, // 缴费方式
|
||||||
pageTitle: options.id ? '编辑报名信息' : '会议报名'
|
pageTitle: options.id ? '编辑报名信息' : '会议报名'
|
||||||
})
|
})
|
||||||
@@ -745,12 +774,28 @@ Page({
|
|||||||
// TODO 好像拿不到企业的其他信息
|
// TODO 好像拿不到企业的其他信息
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success(res) {
|
async success(res) {
|
||||||
|
// 通过接口获取全部的企业信息
|
||||||
|
let result = await that.queryCompanyInfoById(res.data.companyId)
|
||||||
|
let selectedCompany = {
|
||||||
|
companyName: result.companyName,
|
||||||
|
dutyCode: result.dutyCode,
|
||||||
|
companyAddress: result.companyAddress,
|
||||||
|
companyPhone: result.companyPhone,
|
||||||
|
openingBank: result.openingBank,
|
||||||
|
bankAccount: result.bankAccount,
|
||||||
|
linkBankNumber: result.linkBankNumber,
|
||||||
|
id: res.data.companyId
|
||||||
|
}
|
||||||
that.setData({
|
that.setData({
|
||||||
'selectedCompany.companyName': res.data.companyName,
|
selectedCompany
|
||||||
|
})
|
||||||
|
|
||||||
|
that.setData({
|
||||||
|
// 'selectedCompany.companyName': res.data.companyName,
|
||||||
|
// 'selectedCompany.id': res.data.companyId,
|
||||||
'selectedPerson.name': res.data.name,
|
'selectedPerson.name': res.data.name,
|
||||||
'selectedPerson.id': res.data.id,
|
'selectedPerson.id': res.data.id,
|
||||||
'selectedCompany.id': res.data.companyId,
|
|
||||||
phone: res.data.phone,
|
phone: res.data.phone,
|
||||||
'selectedPostPerson.id': res.data.id,
|
'selectedPostPerson.id': res.data.id,
|
||||||
'selectedPostPerson.name': res.data.name,
|
'selectedPostPerson.name': res.data.name,
|
||||||
|
|||||||
@@ -1227,20 +1227,36 @@ Page({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 编辑--用于信息的回显
|
// 编辑--用于信息的回显
|
||||||
edit(record){
|
async edit(record){
|
||||||
this.model = Object.assign({}, record)
|
this.model = Object.assign({}, record)
|
||||||
|
|
||||||
|
// 通过接口获取全部的企业信息
|
||||||
|
let companyInfo = await this.queryCompanyInfoById(this.model.companyId)
|
||||||
|
// 然后和PC端一样对比字段的值,将没有的初始化复制
|
||||||
|
let invoiceKeys = ['dutyCode', 'companyAddress', 'companyPhone', 'openingBank', 'bankAccount', 'linkBankNumber']
|
||||||
|
let invoiceInfo = {}
|
||||||
|
invoiceKeys.map(key => {
|
||||||
|
if(this.model[key]) {
|
||||||
|
invoiceInfo[key] = this.model[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
// 选中的参会单位
|
// 选中的参会单位
|
||||||
const selectedCompany = {
|
const selectedCompany = Object.assign({}, companyInfo, {
|
||||||
id:this.model.companyId,
|
id: this.model.companyId,
|
||||||
companyName:this.model.companyName,
|
companyName: this.model.companyName,
|
||||||
// 写入发票的信息,因为需要回显
|
}, invoiceInfo)
|
||||||
dutyCode:this.model.dutyCode, // 信用代码
|
// 选中的参会单位
|
||||||
companyAddress:this.model.companyAddress, // 公司地址
|
// const selectedCompany = {
|
||||||
companyPhone:this.model.companyPhone, // 公司电话
|
// id:this.model.companyId,
|
||||||
openingBank:this.model.openingBank, // 开户行
|
// companyName:this.model.companyName,
|
||||||
bankAccount:this.model.bankAccount, // 银行账号
|
// // 写入发票的信息,因为需要回显
|
||||||
linkBankNumber:this.model.linkBankNumber // 联行号
|
// 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 = {
|
const selectedPerson = {
|
||||||
id:this.model.companyContactTemporaryId,
|
id:this.model.companyContactTemporaryId,
|
||||||
@@ -1265,6 +1281,7 @@ Page({
|
|||||||
// 缴费方式
|
// 缴费方式
|
||||||
this.updateRadioArr(this.data.paymentMethodList, this.model.payMode)
|
this.updateRadioArr(this.data.paymentMethodList, this.model.payMode)
|
||||||
updateObj.paymentMethodList = this.data.paymentMethodList
|
updateObj.paymentMethodList = this.data.paymentMethodList
|
||||||
|
updateObj.payMethod = this.model.payMode + ''
|
||||||
// 是否选择发票的选中的索引 默认需要
|
// 是否选择发票的选中的索引 默认需要
|
||||||
const index = this.data.needInvoiceList.findIndex(e => e.value === (this.model.needInvoice + '')) + ''
|
const index = this.data.needInvoiceList.findIndex(e => e.value === (this.model.needInvoice + '')) + ''
|
||||||
updateObj.index = index
|
updateObj.index = index
|
||||||
@@ -1351,10 +1368,24 @@ Page({
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// 通过id获取企业的信息
|
||||||
|
queryCompanyInfoById(id) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
let result = {}
|
||||||
|
MeetingApi.queryCompanyInfoById({id}).then(callRes => {
|
||||||
|
if(callRes.success) {
|
||||||
|
result = callRes.result || {}
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
resolve(result)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
|
console.log("------options---------", options)
|
||||||
// options = {
|
// options = {
|
||||||
// id: "1683047817135579138",
|
// id: "1683047817135579138",
|
||||||
// meetingId: "1681693843581128706",
|
// meetingId: "1681693843581128706",
|
||||||
|
|||||||
Reference in New Issue
Block a user