|
@@ -84,6 +84,14 @@ export default {
|
|
|
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: {
|
|
|
},
|
|
@@ -93,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 => ({
|
|
@@ -101,7 +110,36 @@ 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
|
|
|
+ // 如果有列表
|
|
|
+ if (group.ResearcherList) {
|
|
|
+ group.ResearcherList.forEach((item) => {
|
|
|
+ // 对研究员做处理
|
|
|
+ item.text = item.RealName
|
|
|
+ item.value = item.AdminId
|
|
|
+ });
|
|
|
+ }
|
|
|
+ group.children = group.ResearcherList||[]
|
|
|
+ });
|
|
|
+ return list.filter((group) => group.GroupName !== "ficc全体");
|
|
|
},
|
|
|
|
|
|
/* 获取客户信息 */
|
|
@@ -152,6 +190,10 @@ export default {
|
|
|
let isCheck = validateForm(this.formData.activityType,this.formData);
|
|
|
console.log(isCheck)
|
|
|
if(!isCheck) return
|
|
|
+ if(this.isRaiRole&&!this.formData.District) {
|
|
|
+ uni.showToast({title:'请选择路演城市',icon:'none'})
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
|
|
|
let parmas;
|
|
@@ -160,7 +202,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'),
|
|
@@ -170,7 +212,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'),
|
|
@@ -192,6 +234,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,
|
|
@@ -385,18 +428,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({
|
|
@@ -428,7 +491,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;
|
|
|
},
|
|
|
|