|
@@ -81,6 +81,17 @@ export default {
|
|
|
addResearchersIdx() {
|
|
|
return this.formData.selectResearchers.map((item, index) => index).slice(1);
|
|
|
},
|
|
|
+ isRaiRole() {
|
|
|
+ return this.$store.state.userInfo.RoleTypeCode.includes('rai')
|
|
|
+ },
|
|
|
+ //ficc研究员列表
|
|
|
+ ficcReasearcherList(){
|
|
|
+ return (this.researcherList.find(i=>i.text==='ficc')||{}).children||[]
|
|
|
+ },
|
|
|
+ //rai研究员列表
|
|
|
+ raiReasercherList(){
|
|
|
+ return (this.researcherList.find(i=>i.text==='权益')||{}).children||[]
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
},
|
|
@@ -90,7 +101,8 @@ export default {
|
|
|
async getResearcherList() {
|
|
|
const res = await researcherList();
|
|
|
if (res.code !== 200) return
|
|
|
- this.researcherList = res.data.map(group => ({
|
|
|
+
|
|
|
+ /* this.researcherList = res.data.map(group => ({
|
|
|
...group,
|
|
|
text: group.GroupName,
|
|
|
children: group.ResearcherList ? group.ResearcherList.map(child => ({
|
|
@@ -98,7 +110,38 @@ export default {
|
|
|
text: child.RealName,
|
|
|
id: child.AdminId
|
|
|
})) : []
|
|
|
- }));
|
|
|
+ })); */
|
|
|
+
|
|
|
+ const ficcList = this.formatResearcherList(res.data.find(i=>i.GroupName==='ficc').ResearcherList||[]);
|
|
|
+ const raiList = this.formatResearcherList(res.data.find(i=>i.GroupName==='权益').ResearcherList||[]);
|
|
|
+ this.researcherList = [{
|
|
|
+ text:'ficc',
|
|
|
+ value:-1,
|
|
|
+ children:ficcList
|
|
|
+ },{
|
|
|
+ text:'权益',
|
|
|
+ value:-2,
|
|
|
+ children:raiList
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ formatResearcherList(list){
|
|
|
+ list.forEach((group) => {
|
|
|
+ // 对组做处理
|
|
|
+ group.text = group.GroupName
|
|
|
+ group.value = group.GroupId
|
|
|
+ group.id = group.GroupId //非路演,公开会议的活动组件需要用到的字段
|
|
|
+ // 如果有列表
|
|
|
+ if (group.ResearcherList) {
|
|
|
+ group.ResearcherList.forEach((item) => {
|
|
|
+ // 对研究员做处理
|
|
|
+ item.text = item.RealName
|
|
|
+ item.value = item.AdminId
|
|
|
+ item.id = item.AdminId//非路演,公开会议的活动组件需要用到的字段
|
|
|
+ });
|
|
|
+ }
|
|
|
+ group.children = group.ResearcherList||[]
|
|
|
+ });
|
|
|
+ return list.filter((group) => group.GroupName !== "ficc全体");
|
|
|
},
|
|
|
|
|
|
/* 获取客户信息 */
|
|
@@ -120,7 +163,7 @@ export default {
|
|
|
this.telTypeList = data[0].ChildList.map(_ => _.ActivityTypeName);
|
|
|
},
|
|
|
|
|
|
- /* 新增活动成功后操作 */
|
|
|
+ /* ficc-新增活动成功后操作 */
|
|
|
addActivityLink({text,content,link,query}) {
|
|
|
uni.showModal({
|
|
|
title:text,
|
|
@@ -141,6 +184,27 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ addRaiActivityLink() {
|
|
|
+ uni.showModal({
|
|
|
+ title:'添加活动成功,研究员日程已添加成功',
|
|
|
+ content:'可前往【研究员日历】查看',
|
|
|
+ confirmText:'去查看',
|
|
|
+ cancelColor: '#A9AFB8',
|
|
|
+ confirmColor: '#3385FF',
|
|
|
+ success: function(res) {
|
|
|
+ if(res.confirm){
|
|
|
+ //跳转至日历页
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
/* 提交表单 */
|
|
|
async submitHandle() {
|
|
@@ -149,6 +213,10 @@ export default {
|
|
|
let isCheck = validateForm(this.formData.activityType,this.formData);
|
|
|
console.log(isCheck)
|
|
|
if(!isCheck) return
|
|
|
+ if(this.isRaiRole&&this.formData.roadshowType==='线下'&&!this.formData.District) {
|
|
|
+ uni.showToast({title:'请选择路演城市',icon:'none'})
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
|
|
|
let parmas;
|
|
@@ -157,7 +225,7 @@ export default {
|
|
|
) ?
|
|
|
this.formData.selectResearchers.map((item) => ({
|
|
|
ResearcherId: Number(item.researcherId),
|
|
|
- ResearcherName: this.findName(item.researcherId),
|
|
|
+ ResearcherName: this.findResearcherName(item.researcherId),
|
|
|
StartDate: moment(item.startTime).format('YYYY-MM-DD'),
|
|
|
EndDate: moment(item.endTime).format('YYYY-MM-DD'),
|
|
|
StartTime: moment(item.startTime).format('HH:mm:ss'),
|
|
@@ -167,7 +235,7 @@ export default {
|
|
|
})) :
|
|
|
this.formData.selectResearchers[0].researcherId.map((item) => ({
|
|
|
ResearcherId: Number(item),
|
|
|
- ResearcherName: item === 99 ? 'ficc全体' : this.findName(item),
|
|
|
+ ResearcherName: item === 99 ? 'ficc全体' : this.findResearcherName(item),
|
|
|
StartDate: moment(
|
|
|
this.formData.selectResearchers[0].startTime
|
|
|
).format('YYYY-MM-DD'),
|
|
@@ -189,6 +257,7 @@ export default {
|
|
|
ActivityCategory: this.formData.activityClass,
|
|
|
City: this.formData.roadshowCity[1],
|
|
|
Province: this.formData.roadshowCity[0],
|
|
|
+ District:this.formData.District||'',
|
|
|
CooperationName: this.formData.partnersName,
|
|
|
Theme: this.formData.meetingTheme,
|
|
|
RoadshowType: this.formData.roadshowType,
|
|
@@ -214,10 +283,38 @@ export default {
|
|
|
const { text,content,link,query } = this.setDynamicLink(this.formData.activityType);
|
|
|
|
|
|
|
|
|
- this.edit_id ? uni.showToast({
|
|
|
+ /* this.edit_id ? uni.showToast({
|
|
|
title: '提交成功',
|
|
|
icon: 'success'
|
|
|
- }) : this.addActivityLink({text,content,link,query});
|
|
|
+ }) : this.addActivityLink({text,content,link,query}); */
|
|
|
+ if(this.edit_id){
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon: 'success'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if(this.formData.activityType!=='路演'){
|
|
|
+ this.addActivityLink({text,content,link,query})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //判断所选研究员是否有权益
|
|
|
+ const ResearcherIds = this.formData.selectResearchers.map(i=>i.researcherId)
|
|
|
+ const ResearcherTypes = ResearcherIds.map(i=>this.findType(i))
|
|
|
+ console.log('types',ResearcherTypes)
|
|
|
+ //既有权益研究员的路演,又有ficc研究员路演时,提示弹窗
|
|
|
+ if(ResearcherTypes.includes('rai')&&ResearcherTypes.includes('ficc')){
|
|
|
+ const { text, content,link, query } = this.setDynamicLink(
|
|
|
+ 'ficc&rai路演'
|
|
|
+ );
|
|
|
+ this.addActivityLink({text,content,link,query})
|
|
|
+ //只提交权益研究员的路演时,提示弹窗:
|
|
|
+ }else if(ResearcherTypes.includes('rai')){
|
|
|
+ this.addRaiActivityLink()
|
|
|
+ //只提交ficc研究员的路演时,提示弹窗:(维持原来的不变)
|
|
|
+ }else{
|
|
|
+ this.addActivityLink({text,content,link,query})
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.edit_id && setTimeout(() => {
|
|
|
this.cancelHandle();
|
|
@@ -382,18 +479,38 @@ export default {
|
|
|
|
|
|
this.isResearcherPicker = false;
|
|
|
},
|
|
|
+ chooseResearcher({target}){
|
|
|
+ this.formData.selectResearchers[this.selectRsIndex].researcherId = target.value
|
|
|
+ this.isResearcherPicker = false;
|
|
|
+ },
|
|
|
|
|
|
/* 研究员显示格式化为名字 */
|
|
|
formatRsLable(arr) {
|
|
|
if(!arr) return '';
|
|
|
if( arr instanceof Array ) {
|
|
|
return arr.map(item => {
|
|
|
- return this.findName(item)
|
|
|
+ return this.findResearcherName(item)
|
|
|
})
|
|
|
}else {
|
|
|
- return this.findName(arr)
|
|
|
+ return this.findResearcherName(arr)
|
|
|
}
|
|
|
},
|
|
|
+ findResearcherName(id){
|
|
|
+ const isFicc = this.findResearcherById(id,'ficc')
|
|
|
+ const isRai = this.findResearcherById(id,'rai')
|
|
|
+ return isFicc?isFicc.RealName:isRai?isRai.RealName:''
|
|
|
+ },
|
|
|
+ findType(id){
|
|
|
+ const isFicc = this.findResearcherById(id,'ficc')
|
|
|
+ const isRai = this.findResearcherById(id,'rai')
|
|
|
+ return isFicc?'ficc':isRai?'rai':''
|
|
|
+
|
|
|
+ },
|
|
|
+ findResearcherById(id,type='ficc'){
|
|
|
+ const list = type==='ficc'?this.ficcReasearcherList:this.raiReasercherList
|
|
|
+ const flatList = list.map(item=>item.ResearcherList||[]).flat(Infinity)
|
|
|
+ return flatList.find(user=>user.AdminId===id)
|
|
|
+ },
|
|
|
|
|
|
/* 选择路演/会议形式 重置城市平台 */
|
|
|
confirmRoadshowType({
|
|
@@ -425,7 +542,7 @@ export default {
|
|
|
confirmArea({detail}) {
|
|
|
const { values } = detail;
|
|
|
this.formData.roadshowCity = values.map(item => item.name);
|
|
|
-
|
|
|
+ this.formData.District = values.length===3?values[2].name:''
|
|
|
this.isAreaPicker = false;
|
|
|
},
|
|
|
|
|
@@ -487,6 +604,14 @@ export default {
|
|
|
type: '活动申请'
|
|
|
},
|
|
|
}
|
|
|
+ case 'ficc&rai路演' : return {
|
|
|
+ text:'权益研究员日历已添加成功,ficc研究员日历已发送申请,请等待处理',
|
|
|
+ content:'可前往【我的日历】查看',
|
|
|
+ link:'/pages-approve/activity/list',
|
|
|
+ query:{
|
|
|
+ type: '活动申请'
|
|
|
+ },
|
|
|
+ }
|
|
|
case '公开会议' : return {
|
|
|
text: '活动申请已提交,请等待研究员处理',
|
|
|
content: `可前往【我的日历】-【活动申请】查看`,
|