Browse Source

权益研究员添加路演,接口调试

cxmo 1 năm trước cách đây
mục cha
commit
25ad4be2e1

+ 2 - 2
src/components/calendar.vue

@@ -345,7 +345,7 @@ export default {
         }]
         //根据ActivityType判断是什么类型,根据RoadshowType展示对应信息
         const {ActivityType,RoadshowType} = this.selectEventInfo
-        const {Province,City} = this.selectEventInfo
+        const {Province,City,District} = this.selectEventInfo
         //ActivityType为路演时,需要显示的内容
         const {RoadshowPlatform,CompanyName,CompanyStatus} = this.selectEventInfo
         const RoadshowContent = [{
@@ -356,7 +356,7 @@ export default {
         },{
             key:'RoadshowCity',
             label:'路演城市:',
-            content:`${Province}${City}`,
+            content:`${Province}${City}${District}`,
             RoadshowType:'线下'
         },{
             key:'CompanyName',

+ 21 - 14
src/views/roadshow_manage/compononts/addActivityBtnDia.vue

@@ -93,7 +93,7 @@
           <search-dist-picker 
             :provinceInfo="formData.roadshowCity[0]"
             :cityInfo="formData.roadshowCity[1]"
-            :areaInfo="formData.area||''"
+            :areaInfo="formData.District||''"
             :showArea="isRaiRole"
             @selected="onChangeCity($event,'roadshow')"/>
         </el-form-item>
@@ -126,7 +126,7 @@
           "
         >
         <!-- ficc角色看ficc信息 -->
-        <template v-if="isRaiRole">
+        <template v-if="!isRaiRole">
             <template v-if="companyInfo.EnglishCompany===1">
                 <p>所属国家:{{companyInfo.EnglishCountry}}</p>
                 <p>累计点击量:{{companyInfo.EnglishViewTotal}}</p>
@@ -140,10 +140,10 @@
         </template>
         <!-- 权益角色看权益信息 -->
         <template v-else>
-            <p style="margin: 6px 0;">客户状态:{{companyInfo.Status}}</p>
-            <p style="margin: 6px 0;">所属行业:{{companyInfo.IndustryName}}</p>
-            <p style="margin: 6px 0;text-indent: -70px;margin-left: 70px;">行业权限:{{companyInfo.PermissionName}}</p>
-            <p style="margin: 6px 0;">累计互动次数:{{companyInfo.ReportReadTotal}}</p>
+            <p>客户状态:{{companyInfo.Status}}</p>
+            <p>所属行业:{{companyInfo.IndustryName}}</p>
+            <p>行业权限:{{companyInfo.PermissionName}}</p>
+            <p>累计互动次数:{{companyInfo.ReportReadTotal}}</p>
         </template>
         </div>
         <el-form-item
@@ -598,7 +598,7 @@ export default {
       await this.$refs.form.validate();
 
       if(this.formData.companyName && !this.formData.companyId) return this.$message.warning('请选择客户');
-      if(this.isRaiRole&&!this.formData.area) return this.$message.warning('请选择路演城市')
+      if(this.isRaiRole&&!this.formData.District) return this.$message.warning('请选择路演城市')
       
       let parmas;
 
@@ -607,7 +607,7 @@ export default {
       )
         ? this.formData.selectResearchers.map((item) => ({
             ResearcherId: Number(item.researcherId),
-            ResearcherName: this.findName(item.researcherId),
+            ResearcherName: this.findResearcherName(item.researcherId),
             StartDate: this.$moment(item.startDate).format('YYYY-MM-DD'),
             EndDate: this.$moment(item.endDate).format('YYYY-MM-DD'),
             StartTime: this.$moment(item.startTime).format('HH:mm:ss'),
@@ -617,7 +617,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.researcherId),
             StartDate: this.$moment(
               this.formData.selectResearchers[0].startDate
             ).format('YYYY-MM-DD'),
@@ -652,6 +652,7 @@ export default {
         Province: ['公开会议', '路演'].includes(this.formData.activityType)
           ? dynaic_city_param[this.formData.activityType][0]
           : '',
+        District:this.formData.District||'',
         CooperationName: this.formData.partnersName,
         Theme: this.formData.meetingTheme,
         RoadshowType: this.formData.activityType === '路演' ?
@@ -665,7 +666,6 @@ export default {
       };
 
       console.log(parmas);
-
       const res =  this.edit_id
       ? await roadshowInterence.editRoadshow({
           ...parmas,
@@ -684,7 +684,7 @@ export default {
         this.$message.warning('提交成功')
       }else{
         //判断所选研究员是否有权益
-        /* const ResearcherIds = this.formData.selectResearchers.map(i=>i.researcherId)
+        const ResearcherIds = this.formData.selectResearchers.map(i=>i.researcherId)
         const ResearcherTypes = ResearcherIds.map(i=>this.findType(i))
         console.log('types',ResearcherTypes)
         //既有权益研究员的路演,又有ficc研究员路演时,提示弹窗
@@ -700,8 +700,6 @@ export default {
         }else{
             confirmDiaLink(text, content, query)
         } 
-        */
-        confirmDiaLink(text, content, query)
       }
 
       this.$emit('ensureCallback');
@@ -714,7 +712,15 @@ export default {
       const res = await roadshowInterence.getResearcherList();
       if (res.Ret === 200) {
         // this.researcherList=res.Data
-        this.researcherList = this.formatResearcherList(res.Data);
+        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 = [{
+            label:'ficc',
+            ResearcherList:ficcList
+        },{
+            label:'权益',
+            ResearcherList:raiList
+        }]
       }
     },
     // 对获取到的研究员列表做处理
@@ -736,6 +742,7 @@ export default {
       });
       return list;
     },
+
     // 选择的研究员发生改变
     removeResearchersChange(val) {
       this.formData.selectResearchers[0].researcherId = this.formData.selectResearchers[0].researcherId.filter(item => item !== val)

+ 40 - 16
src/views/roadshow_manage/compononts/addActivityCellDia.vue

@@ -192,7 +192,7 @@
         <!-- 客户信息 -->
         <div class="company-info" v-if="formData.activityType === '路演' && formData.companyId && companyInfo">
             <!-- ficc角色看ficc信息 -->
-            <template v-if="isRaiRole">
+            <template v-if="!isRaiRole">
                 <template v-if="companyInfo.EnglishCompany===1">
                     <p>所属国家:{{companyInfo.EnglishCountry}}</p>
                     <p>累计点击量:{{companyInfo.EnglishViewTotal}}</p>
@@ -206,10 +206,10 @@
             </template>
             <!-- 权益角色看权益信息 -->
             <template v-else>
-                <p style="margin: 6px 0;">客户状态:{{companyInfo.Status}}</p>
-                <p style="margin: 6px 0;">所属行业:{{companyInfo.IndustryName}}</p>
-                <p style="margin: 6px 0;text-indent: -70px;margin-left: 70px;">行业权限:{{companyInfo.PermissionName}}</p>
-                <p style="margin: 6px 0;">累计互动次数:{{companyInfo.ReportReadTotal}}</p>
+                <p>客户状态:{{companyInfo.Status}}</p>
+                <p>所属行业:{{companyInfo.IndustryName}}</p>
+                <p>行业权限:{{companyInfo.PermissionName}}</p>
+                <p>累计互动次数:{{companyInfo.ReportReadTotal}}</p>
             </template>
         </div>
         <el-form-item
@@ -506,7 +506,7 @@ export default {
       const res = await roadshowInterence.getResearcherList();
       if (res.Ret === 200) {
 
-        this.researcherList =  res.Data && res.Data.filter(item => item.GroupName !== 'ficc全体').map(group => ({
+        /* this.researcherList =  res.Data && res.Data.filter(item => item.GroupName !== 'ficc全体').map(group => ({
           ...group,
           label: group.GroupName,
           ResearcherList: group.ResearcherList ? group.ResearcherList.map(child => ({
@@ -514,12 +514,21 @@ export default {
             label: child.RealName,
             value: 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 = [{
+            label:'ficc',
+            ResearcherList:ficcList
+        },{
+            label:'权益',
+            ResearcherList:raiList
+        }]
       }
     },
     // 对获取到的研究员列表做处理
     formatResearcherList(list) {
-      this.researcherList =  list && list.filter(item => item.GroupName !== 'ficc全体').map(group => ({
+      /* this.researcherList =  list && list.filter(item => item.GroupName !== 'ficc全体').map(group => ({
         ...group,
         label:group.GroupName,
         ResearcherList: group.ResearcherList && group.ResearcherList.map(child => ({
@@ -527,7 +536,23 @@ export default {
           label: child.RealName,
           value: child.AdminId
         }))
-      }))
+      })) */
+      list.forEach((group) => {
+        // 对组做处理
+        group.label = group.GroupName;
+        // 如果有列表
+        if (group.ResearcherList) {
+          group.ResearcherList.forEach((item) => {
+            // 对研究员做处理
+            item.label = item.RealName;
+            item.value = item.AdminId;
+          });
+        } else {
+          // 没有列表
+          group.value = group.GroupId;
+        }
+      });
+      return list.filter((group) => group.GroupName !== "ficc全体");
 
     },
     // 取消按钮
@@ -547,13 +572,13 @@ export default {
       await this.$refs.form.validate();
 
       if(this.formData.companyName && !this.formData.companyId) return this.$message.warning('请选择客户');
-      if(this.isRaiRole&&!this.formData.area) return this.$message.warning('请选择路演城市')
+      if(this.isRaiRole&&!this.formData.District) return this.$message.warning('请选择路演城市')
       // 设置参数
       let parmas = null;
 
       const param_research = this.formData.selectResearchers.map(item=>({
         ResearcherId: item.researcherId,
-        ResearcherName: this.findResearcherById(item.researcherId),
+        ResearcherName: this.findResearcherName(item.researcherId),
         StartDate:this.$moment(item.startDate).format('YYYY-MM-DD'),
         EndDate: this.$moment(item.endDate).format('YYYY-MM-DD'),
         StartTime: this.$moment(item.startTime).format('HH:mm:ss'),
@@ -572,6 +597,7 @@ export default {
         ActivityCategory: this.formData.activityClass[this.formData.activityClass.length-1],
         City: ['公开会议','路演'].includes(this.formData.activityType) ? dynaic_city_param[this.formData.activityType][1] : '',
         Province: ['公开会议','路演'].includes(this.formData.activityType) ? dynaic_city_param[this.formData.activityType][0] : '',
+        District:this.formData.District||'',
         CooperationName: this.formData.partnersName,
         Theme: this.formData.meetingTheme,
         RoadshowType: this.formData.activityType === '路演' ? this.formData.roadshowType : this.formData.meetingType,
@@ -599,7 +625,7 @@ export default {
         this.$message.warning('提交成功')
       }else{
         //判断所选研究员是否有权益
-        /* const ResearcherIds = this.formData.selectResearchers.map(i=>i.researcherId)
+        const ResearcherIds = this.formData.selectResearchers.map(i=>i.researcherId)
         const ResearcherTypes = ResearcherIds.map(i=>this.findType(i))
         console.log('types',ResearcherTypes)
         //既有权益研究员的路演,又有ficc研究员路演时,提示弹窗
@@ -615,8 +641,6 @@ export default {
         }else{
             confirmDiaLink(text, content, query)
         } 
-        */
-        confirmDiaLink(text, content, query)
       }
       this.$emit('ensureCallback');
       this.cancel();
@@ -698,10 +722,10 @@ export default {
       this.companyInfo = Data;
 
     },
-    // 研究员id查找研究员名
+    /* // 研究员id查找研究员名
     findResearcherById(id){
       return this.allResearcher.find(researcher => researcher.AdminId===id).RealName
-    }
+    } */
   },
   created() {
     this.permission = activityCellDiaConfig[localStorage.getItem("Role")];

+ 2 - 45
src/views/roadshow_manage/myCalendar.vue

@@ -36,7 +36,7 @@
 
               <!-- 活动形式 -->
               <span v-else-if="item.key === 'RoadshowType'">
-                {{row.RoadshowType}} {{ row.RoadshowType === '线上' ? `(${row.RoadshowPlatform}  )` : `(${row.Province}${row.City})`}}
+                {{row.RoadshowType}} {{ row.RoadshowType === '线上' ? `(${row.RoadshowPlatform}  )` : `(${row.Province}${row.City}${row.District})`}}
               </span>
 
               <!-- 状态 -->
@@ -59,7 +59,7 @@
                   <i class="el-icon-info"/>
                   <div slot="content" v-if="companyInfo">
                     <!-- 权益客户 -->
-                    <template v-if="companyInfo.type==='rai'">
+                    <template v-if="Role.includes('rai')">
                         <p style="margin: 6px 0;">客户状态:{{companyInfo.Status}}</p>
                         <p style="margin: 6px 0;">所属行业:{{companyInfo.IndustryName}}</p>
                         <p style="margin: 6px 0;text-indent: -70px;margin-left: 70px;">行业权限:{{companyInfo.PermissionName}}</p>
@@ -414,48 +414,6 @@ export default {
     async getCompanyInfo({CompanyId,EnglishCompany,ActivityType,ResearcherId}) {
       const { Data }  = await roadshowInterence.componyDetail({ CompanyId,EnglishCompany });
       this.companyInfo = Data;
-      //若是路演,则判断该路演是否有权益研究员,若有,将companyInfo.type置为rai
-      if(ActivityType === "路演"){
-        const ResearcherTypes = ResearcherId.split(',').map(i=>this.findType(Number(i)))
-        if(ResearcherTypes.includes('rai')){
-            this.companyInfo.type = 'rai'
-        }
-      }
-    },
-    // 获取研究员列表
-    async getResearcherList() {
-      const res = await roadshowInterence.getResearcherList();
-      if (res.Ret === 200) {
-        this.researcherList = this.formatResearcherList(res.Data);
-      }
-    },
-    // 对获取到的研究员列表做处理
-    formatResearcherList(list) {
-      list.forEach((group) => {
-        // 对组做处理
-        group.label = group.GroupName;
-        // 如果有列表
-        if (group.ResearcherList) {
-          group.ResearcherList.forEach((item) => {
-            // 对研究员做处理
-            item.label = item.RealName;
-            item.value = item.AdminId;
-          });
-        } else {
-          // 没有列表
-          group.value = group.GroupId;
-        }
-      });
-      return list;
-    },
-    findType(id){
-        const flat_arr = _.cloneDeep(this.researcherList)
-        .map((item) => item.ResearcherList || [])
-        .flat(Infinity);
-
-        return flat_arr.find((user) => user.AdminId === id) //RoleTypeCode字段待定
-            ? flat_arr.find((user) => user.AdminId === id).RoleTypeCode==='aaa'?'ficc':'rai'
-            : 'ficc';
     },
 
     // 撤回操作
@@ -747,7 +705,6 @@ export default {
   },
   mounted() {
     this.init();
-    this.getResearcherList()
 
   },
 };

+ 9 - 1
src/views/roadshow_manage/researcherCalendar.vue

@@ -138,7 +138,15 @@ export default {
       const res = await roadshowInterence.getResearcherList();
       if (res.Ret === 200) {
         // this.researcherList=res.Data
-        this.researcherList = this.formatResearcherList(res.Data);
+        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 = [{
+            label:'ficc',
+            ResearcherList:ficcList
+        },{
+            label:'权益',
+            ResearcherList:raiList
+        }]
       }
     },
     

+ 2 - 2
src/views/roadshow_manage/roleConfig/index.js

@@ -24,7 +24,7 @@ export const confirmDiaLink = (sub_msg,message,query) => {
 		cancelButtonText: '关闭',
 	}).then(action => {
 		router.push({path:'/myCalendar',query})
-	});
+	}).catch(()=>{});
 }
 //给权益研究员添加的日历 确认弹窗 需要停留在原先页面
 export const confirmDiaRai = ()=>{
@@ -37,5 +37,5 @@ export const confirmDiaRai = ()=>{
 		cancelButtonText: '关闭',
 	}).then(action => {
 		//什么也不做
-	});
+	}).catch(()=>{});
 }

+ 23 - 8
src/views/roadshow_manage/roleConfig/mixins.js

@@ -105,7 +105,7 @@ export default {
 			console.log(val)
 			if (type === "roadshow") {
 				this.formData.roadshowCity = [val.province.value,val.city.value];
-				this.formData.area = val.area.value
+				this.formData.District = val.area.value
 				this.$refs.form.clearValidate(['roadshowCity'])
 			} else if (type === "meeting") {
 				this.formData.meetingCity = [val.province.value, val.city.value];
@@ -113,14 +113,21 @@ export default {
 			}
 		},
 		findType(id){
-			const flat_arr = _.cloneDeep(this.researcherList)
-			.map((item) => item.ResearcherList || [])
-			.flat(Infinity);
-	
-			return flat_arr.find((user) => user.AdminId === id) //RoleTypeCode字段待定
-				? flat_arr.find((user) => user.AdminId === id).RoleTypeCode==='aaa'?'ficc':'rai'
-				: 'ficc';
+			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)
 		},
+		findResearcherName(id){
+			const isFicc = this.findResearcherById(id,'ficc')
+			const isRai = this.findResearcherById(id,'rai')
+			return isFicc?isFicc.RealName:isRai?isRai.RealName:''
+		}
 	},
 	watch: {
     'formData.companyName'(val) {
@@ -142,6 +149,14 @@ export default {
 	computed:{
 		isRaiRole(){//是否为权益角色
 			return localStorage.getItem('Role').includes('rai')
+		},
+		//ficc研究员列表
+		ficcReasearcherList(){
+			return (this.researcherList.find(i=>i.label==='ficc')||{}).ResearcherList||[]
+		},
+		//rai研究员列表
+		raiReasercherList(){
+			return (this.researcherList.find(i=>i.label==='权益')||{}).ResearcherList||[]
 		}
 	}
 }