Przeglądaj źródła

crm15.5 接口调试

cxmo 1 rok temu
rodzic
commit
66bd961a45

+ 30 - 13
pages-roadshow/addActivity/byCell.vue

@@ -94,16 +94,26 @@
 			/>
 			
 			<view class="company-info" v-if="formData.activityType === '路演' && formData.companyId && companyInfo">
-				<template v-if="companyInfo.EnglishCompany">
-          <view>所属国家:{{companyInfo.EnglishCountry}}</view>
-          <view>累计点击量:{{companyInfo.EnglishViewTotal}}</view>
-        </template>
-        <template v-else>
-          <view>客户状态:{{companyInfo.Status}}</view>
-          <view>所属行业:{{companyInfo.IndustryName}}</view>
-          <view>开通品种:{{companyInfo.PermissionName}}</view>
-          <view>累计报告阅读次数:{{companyInfo.ReportReadTotal}}</view>
-        </template>
+				<!-- ficc角色看ficc信息 -->
+				<template v-if="!isRaiRole">
+					<template v-if="companyInfo.EnglishCompany===1">
+						<p>所属国家:{{companyInfo.EnglishCountry}}</p>
+						<p>累计点击量:{{companyInfo.EnglishViewTotal}}</p>
+					</template>
+					<template v-else>
+						<p>客户状态:{{ companyInfo.Status }}</p>
+						<p>所属行业:{{ companyInfo.IndustryName }}</p>
+						<p>开通品种:{{ companyInfo.PermissionName }}</p>
+						<p>累计报告阅读次数:{{ companyInfo.ReportReadTotal }}</p> 
+					</template>
+				</template>
+				<!-- 权益角色看权益信息 -->
+				<template v-else>
+					<p>客户状态:{{companyInfo.Status}}</p>
+					<p>所属行业:{{companyInfo.IndustryName}}</p>
+					<p>行业权限:{{companyInfo.PermissionName}}</p>
+					<p>累计互动次数:{{companyInfo.ReportReadTotal}}</p>
+				</template>
 			</view>
 
 			<van-field 
@@ -228,16 +238,23 @@
 
 		<!-- 选择研究员 -->
 		<van-popup :show="isResearcherPicker" position="bottom">
-			<view class="select-rs-header">
+			<!-- <view class="select-rs-header">
 				<text class="cancel" @click="cancelResearcher">取消</text>
 				<text class="ensure" @click="confirmResearcher">确认</text>
-			</view>
-			<van-tree-select 
+			</view> -->
+			<!-- <van-tree-select 
 				:items="researcherList" 
 				:main-active-index="rs_picker.firstindex" 
 				:active-id="rs_picker.id"
 				@click-nav="clickFirstHandle" 
 				@click-item="clickItemHandle" 
+			/> -->
+			<van-cascader
+				title="请选择研究员"
+				active-color="#3385FF"
+				:options="researcherList"
+				@close="cancelResearcher"
+				@finish="chooseResearcher"
 			/>
 		</van-popup>
 

+ 28 - 11
pages-roadshow/addActivity/index.vue

@@ -57,16 +57,26 @@
 			/>
 			
 			<view class="company-info" v-if="formData.activityType === '路演' && formData.companyId && companyInfo">
-        <template v-if="companyInfo.EnglishCompany">
-          <view>所属国家:{{companyInfo.EnglishCountry}}</view>
-          <view>累计点击量:{{companyInfo.EnglishViewTotal}}</view>
-        </template>
-        <template v-else>
-          <view>客户状态:{{companyInfo.Status}}</view>
-          <view>所属行业:{{companyInfo.IndustryName}}</view>
-          <view>开通品种:{{companyInfo.PermissionName}}</view>
-          <view>累计报告阅读次数:{{companyInfo.ReportReadTotal}}</view>
-        </template>
+			<!-- ficc角色看ficc信息 -->
+			<template v-if="!isRaiRole">
+				<template v-if="companyInfo.EnglishCompany===1">
+					<p>所属国家:{{companyInfo.EnglishCountry}}</p>
+					<p>累计点击量:{{companyInfo.EnglishViewTotal}}</p>
+				</template>
+				<template v-else>
+					<p>客户状态:{{ companyInfo.Status }}</p>
+					<p>所属行业:{{ companyInfo.IndustryName }}</p>
+					<p>开通品种:{{ companyInfo.PermissionName }}</p>
+					<p>累计报告阅读次数:{{ companyInfo.ReportReadTotal }}</p> 
+				</template>
+			</template>
+			<!-- 权益角色看权益信息 -->
+			<template v-else>
+				<p>客户状态:{{companyInfo.Status}}</p>
+				<p>所属行业:{{companyInfo.IndustryName}}</p>
+				<p>行业权限:{{companyInfo.PermissionName}}</p>
+				<p>累计互动次数:{{companyInfo.ReportReadTotal}}</p>
+			</template>
 				
 			</view>
 
@@ -229,7 +239,7 @@
 
 		<!-- 选择研究员 -->
 		<van-popup :show="isResearcherPicker" position="bottom">
-			<view class="select-rs-header">
+			<!-- <view class="select-rs-header">
 				<text class="cancel" @click="cancelResearcher">取消</text>
 				<text class="ensure" @click="confirmResearcher">确认</text>
 			</view>
@@ -239,6 +249,13 @@
 				:active-id="rs_picker.id"
 				@click-nav="clickFirstHandle" 
 				@click-item="clickItemHandle" 
+			/> -->
+			<van-cascader
+				title="请选择研究员"
+				active-color="#3385FF"
+				:options="researcherList"
+				@close="cancelResearcher"
+				@finish="chooseResearcher"
 			/>
 		</van-popup>
 

+ 70 - 7
pages-roadshow/addActivity/mixin.js

@@ -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;
 		},
 

+ 1 - 1
utils/config.js

@@ -9,7 +9,7 @@ if(env.envVersion==='develop'){//开发
     baseUrl='http://8.136.199.33:8607/h5adminapi';
     // linkRoadshowUrl='http://localhost:3000/xcx_h5/ssbg';
     // linkRoadshowUrl='http://advisoryadmin.brilliantstart.cn/xcx_h5/ssbg';
-    linkRoadshowUrl='https://xcxh5test.hzinsights.com/xcx_h5/ssbg';
+    linkRoadshowUrl='http://192.168.77.18:3000/xcx_h5/ssbg';
 }else if(env.envVersion==='trial'){//体验版
     baseUrl='https://xcxh5test.hzinsights.com/h5adminapi';
 		linkRoadshowUrl='https://xcxh5test.hzinsights.com/xcx_h5/ssbg';