Explorar o código

客户列表,联系人列表,详情页与编辑页操作按钮保持一致

cxmo hai 1 ano
pai
achega
d019915b2e

+ 1 - 1
src/views/custom_manage/customList/customDetail.vue

@@ -371,7 +371,7 @@
 							<template slot-scope="scope"> <span>{{scope.row.MfyxStartDate}} -- {{scope.row.MfyxEndDate}}</span> </template>
 						</el-table-column>
 					</template>
-					<el-table-column label="操作" align="center" min-width="150">
+					<el-table-column label="操作" align="center" min-width="155">
 						<template slot-scope="scope"  v-if="isContractButtonShow">
 							<div class="contact-opt-box" style="color:#4099ef; font-size:14px;">
 								<span  class="editsty" @click="editContact(scope.row)">编辑</span>

+ 369 - 17
src/views/custom_manage/customList/editCustom.vue

@@ -231,19 +231,65 @@
 					<!-- <span style="fontSize:16px;color:#AAB4CC;">(请至少添加一位联系人)</span> -->
 					<a :href="downTemplate" download style="fontSize:14px;color:#409eff;margin-left:30px">下载导入模板</a>
 				</div>
-				<el-input
-					placeholder="姓名/手机号码/邮箱"
-					v-model="search_txt"
-					@input="searchUser"
-					style="maxWidth:500px">
-					<i slot="prefix" class="el-input__icon el-icon-search"></i>
-				</el-input>
+				<div style="display: flex">
+					<template v-if="!isUserYanXuanButtonShow">
+					  <el-select 
+						  v-model="IsSubscribe"
+						  placeholder="是否关注公众号" 
+						  multiple
+						  clearable
+						  style="margin-right: 10px;width: 300px;" 
+						  @change="changeSubscribe"
+					  >
+						  <el-option 
+							  label="已关注弘则研究"
+							  value="1"
+							  :disabled="IsSubscribe.includes('2')"
+						  />
+						  <el-option 
+							  label="已关注查研观向小助手"
+							  value="3"
+							  :disabled="IsSubscribe.includes('4')"
+						  />
+						  <el-option 
+							  label="未关注弘则研究"
+							  value="2"
+							  :disabled="IsSubscribe.includes('1')"
+						  />
+						  <el-option 
+							  label="未关注查研观向小助手"
+							  value="4"
+							  :disabled="IsSubscribe.includes('3')"
+						  />
+					  </el-select>
+	
+					  <el-select v-model="platform_type" style="margin-right: 10px;width: 250px;" @change="changeSubProductHandle">
+						  <el-option
+							  v-for="item in platformOption"
+							  :key="item.key"
+							  :label="item.ProductName"
+							  :value="item.key"
+						  >
+							  {{ item.ProductName }}
+						  </el-option>
+					  </el-select>
+					</template>
+					  <el-input
+						  placeholder="姓名/手机号码/邮箱"
+						  v-model="search_txt"
+						  style="maxWidth:400px"
+						  @input="searchUser"
+						  clearable>
+						  <i slot="prefix" class="el-input__icon el-icon-search"></i>
+					  </el-input>
+				</div>
 			</div>
 			<div class="bot_cont">
 				<el-table
 				ref="userTable"
 				:data="userTable"
 				v-loading="isShowloadding"
+				:row-class-name="setRowClass"
 				element-loading-text="数据加载中..."
 				border>
 					<el-table-column
@@ -251,9 +297,10 @@
 					label="姓名"
 					align="center">
 						<template slot-scope="scope">
-							<img :src="$icons.card" alt="" style="width:17px;cursor:pointer;marginRight:5px;" 
-							v-if="scope.row.BusinessCardUrl"
-							@click="reviewCard(scope.row.BusinessCardUrl)">
+							<img :src="$icons.card" alt="" style="width:17px;cursor:pointer;marginRight:5px;"
+								v-if="scope.row.BusinessCardUrl"
+								@click="reviewCard(scope.row.BusinessCardUrl)">
+							<img src="~@/assets/img/icons/like-heart.png" class="name-follow-heart" v-if="scope.row.IsFollow==1">
 							<span>{{scope.row.RealName}}</span>
 						</template>
 					</el-table-column>
@@ -291,6 +338,24 @@
 						<template slot-scope="scope"> <span>{{scope.row.RegisterTime}}</span> </template>
 					</el-table-column>
 					<el-table-column
+					prop="IsSubscribeHzyj"
+					label="是否关注公众号"
+					min-width="90"
+					align="center">
+						<template slot-scope="scope">
+							<div style="text-align:left" v-if="RoleType !=='权益'">
+								<img v-if="scope.row.IsSubscribeHzyj==1" style="width:16px;height:16px" src="~@/assets/img/icons/icon_1.png" alt="">
+								<img v-else style="width:16px;height:16px" src="~@/assets/img/icons/icon_2.png" alt="">
+								<span>弘则研究</span>
+							</div>
+							<div style="text-align:left">
+								<img v-if="scope.row.IsSubscribeCygx==1" style="width:16px;height:16px" src="~@/assets/img/icons/icon_1.png" alt="">
+								<img v-else style="width:16px;height:16px" src="~@/assets/img/icons/icon_2.png" alt="">
+								<span>查研观向小助手</span>
+							</div>
+						</template>
+					</el-table-column>
+					<el-table-column
 					prop="ViewTotal"
 					label="累计阅读次数"
 					align="center">
@@ -304,14 +369,26 @@
 						<template slot-scope="scope"> <span>{{scope.row.ViewTotal?scope.row.LastViewTimeStr:''}}</span> </template>
 					</el-table-column>
 					<el-table-column
-					label="阅读报告列表"
+					label="研报统计"
 					align="center">
 						<template slot-scope="scope"> <span v-if="scope.row.ViewTotal!=0" class="editsty" @click="lookReport(scope.row)">点击查看</span></template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" width="140px">
+					<el-table-column
+						v-if="ficcform && !isUserYanXuanButtonShow"
+						prop="YbProductViewTotal"
+						label="其他统计"
+						min-width="110"
+						align="center">
+						<template slot-scope="scope"> <span :class="scope.row.YbProductViewTotal?'editsty':''" @click="lookReadInfo(scope.row)">{{scope.row.YbProductViewTotal||'0'}}</span> </template>
+					</el-table-column>
+					<el-table-column label="操作" align="center" min-width="155">
 						<template slot-scope="scope">
-							<div style="color:#4099ef; font-size:24px;">
-								<span class="editsty" style="marginRight:8px;" @click="editContact(scope.row)">编辑</span>
+							<div style="color:#4099ef; font-size:14px;">
+								<span class="editsty" @click="editContact(scope.row)">编辑</span>
+								<span class="editsty move" style="margin:0 5px;" @click="handleShowMove(scope.row)">移动</span>
+								<span style="margin-right:5px;" :class="scope.row.IsFollow==1?'deletesty':'editsty'"
+								@click="followContact(scope.row)"
+								>{{ scope.row.IsFollow==1?'取消关注':'关注' }}</span>
 								<span class="deletesty" @click.stop="delConcat(scope.row)">删除</span>
 							</div>
 						</template>
@@ -354,6 +431,16 @@
 		:title="readTit"
 		@cancelRead="cancelRead">
 		</Readia>
+		<!-- 分产品阅读统计弹窗 -->
+		<product-read-info
+		:productReadInfoShow="productReadInfoShow"
+		:productReadId="productReadId"
+		:subProductId="platform_type"
+		:subProductName="subProductName"
+		:clickToal="clickToal"
+		:productReadTitle="productReadTitle"
+		@close="productReadInfoShow=false"
+		></product-read-info>
 		<!-- 图片预览 -->
 		<el-image-viewer 
 		v-if="showViewer" 
@@ -455,6 +542,88 @@
 				<el-button  type="primary" plain style="width:80px;" @click="closeDia">取消</el-button>
 			</div>
 		</el-dialog>
+		<!-- 移动联系人弹窗 -->
+		<el-dialog
+			title="提示"
+			:visible.sync="isMove"
+			:close-on-click-modal="false"
+			:modal-append-to-body="false"
+			@close="cancelMove"
+			center
+			top="25vh"
+			width="500px">
+			<div slot="title" style="display: flex; align-items: center; position: relative">
+				<img
+					src="../../../assets/img/icons/move.png"
+					style="color: #fff; width: 16px; height: 16px; margin-right: 5px"/>
+				<span style="font-size: 16px">移动联系人</span>
+				<i
+					class="el-icon-close"
+					style="
+						font-size: 24px;
+						cursor: pointer;
+						position: absolute;
+						right: 20px;
+						top: 50%;
+						transform: translateY(-50%);
+					"
+					@click="cancelMove"
+				></i>
+			</div>
+			<el-form
+				@submit.native.prevent
+				:model="moveForm"
+				ref="moveFormvalidate"
+				inline
+				:rules="moveRule"
+				label-width="80px"
+				class="demo-ruleForm"
+				style="margin-top: 15px">
+				<el-form-item
+					label="移动到"
+					prop="companyId"
+					style="width: 100%">
+					<el-select
+						v-model="moveForm.companyId"
+						filterable
+						remote
+						:remote-method="getCompany"
+						@focus="focusGetCompany"
+						@change="getCompanySeller"
+						placeholder="请选择公司"
+						style="width: 280px">
+						<el-option
+							v-for="item in typeArr"
+							:key="item.CompanyId"
+							:label="item.CompanyName"
+							:value="item.CompanyId">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item
+					label="所属销售"
+					prop="belongUser"
+					style="width: 100%"
+					v-if="!hideBelongUser">
+					<el-select
+						v-model="moveForm.belongUser"
+						placeholder="请选择对应销售"
+						style="width: 280px">
+						<el-option
+							v-for="item in belongList"
+							:key="item.AdminId"
+							:label="item.RealName"
+							:value="item.AdminId">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<div v-if="isMoveShowTips&&ficcform&&['正式','试用','永续'].includes(ficcform.Status)" style="text-align:center;color:#999">提示:移动联系人会关闭该联系人的图表权限</div>
+				<div style="display: flex; justify-content: center; margin: 30px 0 55px">
+					<el-button type="primary" @click="submitMove">保存</el-button>
+					<el-button @click="cancelMove">取消</el-button>
+				</div>
+			</el-form>
+		</el-dialog>
 	</div>	
 </template>
 
@@ -462,6 +631,7 @@
 import Ctimeline from '../compontents/Ctimeline.vue'
 import Contactdia from '../compontents/Contactdialog.vue'
 import Readia from '../compontents/ReadDialog.vue'
+import ProductReadInfo from '../compontents/ProductReadInfo.vue'
 import CpessionTable from '../compontents/CpessionTable.vue'
 import { customInterence } from '@/api/api.js'
 //import{province_sorce,city_sorce} from '@/utils/distpicker';
@@ -473,7 +643,7 @@ import country from "@/utils/countryData"
 
 export default {
 	name:'',
-	components: {Ctimeline,Contactdia,Readia,ElImageViewer,CpessionTable,autocomplete,searchDistPicker},
+	components: {Ctimeline,Contactdia,Readia,ProductReadInfo,ElImageViewer,CpessionTable,autocomplete,searchDistPicker},
 	computed:{
 		Role() {
 			let role = localStorage.getItem('Role') || '';
@@ -667,6 +837,29 @@ export default {
 			codeRepeat:false,
 			isCheckCompanyInfo:false,
 			checkCompanyfocusIs:false, //
+
+			isUserYanXuanButtonShow:false,//是否显示研选的按钮以及表格
+			IsSubscribe:[],//是否关注公众号
+			platform_type: 1,
+			platformOption:[],
+			subProductName: '',//分产品名称
+			clickToal:'',//点击量
+			productReadInfoShow:false,//分产品阅读统计弹窗
+			productReadId:0,//联系人ID
+			productReadTitle:'',//分产品阅读统计弹窗的标题
+
+			isMove:false,//移动联系人弹窗
+			isMoveShowTips:false,//移动联系人弹窗中是否提示移动联系人将重置图表权限
+			moveForm:{
+				companyId:'',
+				belongUser:''
+			},
+			moveRule:{
+				companyId:[{ required: true, message: "公司不能为空", trigger: "change" }],
+				belongUser:[{ required: true, message: "所属销售不能为空", trigger: "change" }]
+			},
+			belongList:[],//所属销售列表
+			typeArr: [], //公司列表
 		};
 	},
 	methods: {
@@ -869,6 +1062,8 @@ export default {
 							this.authList2 = auth2;
 						}
 					}
+
+					this.isUserYanXuanButtonShow = res.Data.IsUserYanXuanButtonShow
 				}
 			})
 		},
@@ -921,13 +1116,73 @@ export default {
 			})
 		 },500)
 		},
+		lookReadInfo(item){
+			if(!item.YbProductViewTotal) return 
+			this.productReadId = item.UserId
+			this.productReadTitle = item.RealName + '其他统计'
+			this.clickToal = item.YbProductViewTotal
+			this.productReadInfoShow = true
+		},
+		/* 获取分产品的几种类型 */
+		getSubProductList() {
+			customInterence.getSubProduct({StatisticFlag:true}).then(res => {
+				if(res.Ret !== 200) return
+				
+				res.Data.forEach(item => {
+					item.key = `${item.ProductType}-${item.ProductId}`
+				})
+				this.platformOption = res.Data;
+				this.platform_type = `${res.Data[0].ProductType}-${res.Data[0].ProductId}`;
+				this.subProductName = res.Data[0].ProductName;
+				
+				this.getuserTable();
+			})
+		},
+		changeSubProductHandle(val) {
+			this.search_txt = '';
+			let obj = this.platformOption.find(_ =>_.key === val);
+			this.subProductName = obj.ProductName;
+			this.getuserTable();
+		},
+		changeSubscribe(){
+			this.search_txt = '';
+			this.getuserTable();
+		},
+		// 关注与取消关注
+		followContact(row){
+			// console.log(row);
+			let isFollow = row.IsFollow==1
+			let confirmText = isFollow?'是否取消':'是否设为'
+			this.$confirm(`${confirmText}特别关注?`, "提示", {
+				type: "warning",
+			}).then(() => {
+				let params={
+					UserId:row.UserId,
+					CompanyId:row.CompanyId,
+					Type:isFollow?0:1
+				}
+				customInterence.concactFollow(params).then(res=>{
+					if(res.Ret == 200){
+						this.$message.success(isFollow?"取消成功":"关注成功")
+						this.getuserTable()
+					}
+				})
+
+			})
+			.catch(() => {});
+		},
 		/* 获取联系人列表 */
 		getuserTable() {
+			const subProductArr = this.platform_type.split('-');
 			customInterence.concactList({
 				PageSize:10,
 				CurrentIndex:this.page_no,
 				CompanyId:this.companyId,
-				KeyWord:this.search_txt
+				KeyWord:this.search_txt,
+				ProductType: Number(subProductArr[0]),
+				ProductId: Number(subProductArr[1]),
+				IsSubscribeHzyj:this.IsSubscribe.includes('1')?1:this.IsSubscribe.includes('2')?0:'',
+				IsSubscribeCygx:this.IsSubscribe.includes('3')?1:this.IsSubscribe.includes('4')?0:'',
 			}).then(res => {
 				
 				if(res.Ret === 200) {
@@ -1190,6 +1445,86 @@ export default {
 				this.getuserTable();
 			}
 		},
+		//获取公司对应的销售列表
+		getCompanySeller(){
+			this.moveForm.belongUser=null
+			customInterence.companySellerList({CompanyId:Number(this.moveForm.companyId)}).then(res=>{
+				if(res.Ret===200){
+				if(!res.Data.List){
+					this.hideBelongUser=true
+					this.moveRule.belongUser[0].required=false
+					return
+				}
+				if(res.Data.List.length===1){
+					this.moveForm.belongUser=res.Data.List[0].AdminId
+				}
+				this.belongList=res.Data.List
+				this.moveRule.belongUser[0].required=true
+				this.hideBelongUser=false
+				}
+			})
+		},
+		//显示移动联系人弹窗
+		handleShowMove(e){
+			this.userId = e.UserId;
+			this.isMoveShowTips=e.IsChartPermissionSetting==0?false:true
+			this.isMove=true
+		},
+		//关闭移动联系人弹窗
+		cancelMove(){
+			this.isMove=false
+			this.isMoveShowTips=false
+			this.hideBelongUser=false
+			this.moveForm.companyId=''
+			this.moveForm.belongUser=''
+			this.moveRule.belongUser[0].required=true
+			this.$refs.moveFormvalidate.resetFields();
+		},
+		//提交移动联系人
+		submitMove(){
+			this.$refs.moveFormvalidate.validate((valid,key)=>{
+				if(!valid) return
+				console.log(this.moveForm.companyId,this.moveForm.belongUser,this.userId);
+				customInterence
+				.moveCustom({
+					CompanyId:Number(this.moveForm.companyId),
+					SellerId:Number(this.moveForm.belongUser)||0,
+					UserId:Number(this.userId)
+				}).then(res=>{
+					if(res.Ret===200){
+						this.$message.success('移动成功');
+						this.$router.go(0)
+					}
+				})
+			})
+		},
+		focusGetCompany() {
+			customInterence
+			.companySearch({
+				KeyWord: "##",
+			})
+			.then((res) => {
+				if (res.Ret === 200) {
+					this.typeArr = res.Data.List || [];
+				}
+			});
+		},
+		/* 过滤公司 */
+		getCompany(query) {
+			if (query) {
+				customInterence
+				.companySearch({
+					KeyWord: query,
+				})
+				.then((res) => {
+					if (res.Ret === 200) {
+					this.typeArr = res.Data.List || [];
+					}
+				});
+			} else {
+				this.typeArr = [];
+			}
+		},
 		/* 页码改变 */
 		handleCurrentChange(page) {
 			this.page_no = page;
@@ -1349,12 +1684,19 @@ export default {
 		closeDia() {
 			this.isCheck = false;
 		},
+		// 设置表格行的样式
+		setRowClass({row}){
+			if(row.NotRead && row.IsFollow==1){
+				return "not-read-seven-days"
+			}
+		}
 	},
 	created() {},
 	mounted() {
 		this.getDetail();
 		this.getSale();
-		this.getuserTable();
+		/* this.getuserTable(); */
+		this.getSubProductList()
 		this.getCustomerSourceList()
 		this.getIndustry('ficc')
 		this.getIndustry('权益')
@@ -1446,6 +1788,16 @@ export default {
 		align-items: center;
 		margin-bottom: 28px;
 	}
+	.name-follow-heart{
+		width:25px;
+		height: 15px;
+		position: absolute;
+		left: 0;
+		top: 0;
+	}
+	.not-read-seven-days{
+		background-color: #FFF8F8;
+	}
 }
 .el-autocomplete-suggestion-data-entry {
 	width:auto !important;