Ver Fonte

commit -m 协销权限订单

zhengjinyi há 2 anos atrás
pai
commit
b605866dfc

+ 8 - 2
components/cm-module/headerNavbar/header-back.vue

@@ -12,7 +12,7 @@
 		<view class="navbar-icon" v-if="navbarData.showSearch == 1 ? true : false"
 			  :style="{top:navbarBtn.top + statusBarHeight+'px;',right:(navbarBtn.width)+'px;',height:navbarBtn.height+'px;',lineHeight:navbarBtn.height+'px;'}">
 			  <text @click.stop="_goSearchPath" class="iconfont icon-iconfonticonfontsousuo1"></text>
-			  <text v-if="manager && manager > 0" @click.stop="_showRightDrawer" class="iconfont icon-shaixuan"></text>
+			  <text v-if="screenTab === 3" @click.stop="_showRightDrawer" class="iconfont icon-shaixuan"></text>
 	  	</view>
 	</view>
 </template>
@@ -40,7 +40,7 @@
 			isUsertype:{
 				type:Number
 			},
-			manager:{
+			screenTab:{
 				type:Number
 			}
 		},
@@ -100,6 +100,12 @@
 		    this.navbarHeight= headerPosi.bottom + btnPosi.bottom, // 原胶囊bottom + 现胶囊bottom
 		    this.navbarBtn=btnPosi
 		},
+		watch: {
+		  screenTab(newVal, oldVal){
+		    // newVal是新值,oldVal是旧值
+		    this.screenTab = newVal
+		  }
+		},
 		methods:{
 			_goBack() {
 				if(this.isShare){

+ 2 - 1
components/cm-module/orderDetails/orderAddress.vue

@@ -27,6 +27,7 @@
 </template>
 
 <script>
+	import { mapState, mapMutations } from 'vuex'	
 	export default{
 		name:"address",
 		props:{
@@ -43,7 +44,7 @@
 			this.initData = this.addressData;
 		},
 		computed: {
-
+			...mapState(['isManage'])
 		},
 		methods:{
 			

+ 0 - 1
components/cm-module/pageTemplate/templateL.vue

@@ -84,7 +84,6 @@ export default {
 			const userInfo = await this.$api.getStorage()
 			this.shopId = userInfo.shopId ? userInfo.shopId : 0
 			this.productList = data.floorImageList4
-			console.log('==========',this.productList)
 			// if (this.productCount > 0) {
 			// 	this.productList.splice(0, this.productList.length)
 			// 	for (var i = 0, j = data.floorImageList4.length; i < j; i += this.pageSize) {

+ 1 - 1
pages/seller/club/club-info.vue

@@ -82,7 +82,7 @@
 			</view>
 		</template>
 		<!-- 按钮 -->
-		<template v-if="!clubInfo.serviceProviderId">
+		<template v-if="clubInfo.spType === 0">
 			<tui-bottom-popup :radius="false" :mask="false" :show="true">
 				<view class="tui-popup-box clearfix">
 					<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">

+ 22 - 12
pages/seller/club/list.vue

@@ -44,7 +44,7 @@
 						height: capsule.height + 'px',
 						lineHeight: capsule.height + 'px;'
 					}"
-					v-if="listQuery.manager > 0"
+					v-if="isManage && tabSmallCurrentIndex == 1"
 					@click="showRightDrawer"
 				>
 					<text class="iconfont icon-shaixuan"></text>
@@ -61,7 +61,7 @@
 					<text class="item-text">{{ item.name }}<text class="line"></text></text>
 				</view>
 			</view>
-			<view class="search-smalltab" v-if="listQuery.manager > 0">
+			<view class="search-smalltab" v-if="isManage">
 				<view
 					class="tab-item"
 					v-for="(item, index) in listItemTab"
@@ -73,7 +73,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="club-main" :style="{ paddingTop: listQuery.manager > 0 ? '374rpx' : '268rpx' }">
+		<view class="club-main" :style="{ paddingTop: isManage ? '374rpx' : '268rpx' }">
 			<view v-if="isEmpty" class="empty-container">
 				<image
 					class="club-empty-image"
@@ -103,11 +103,13 @@
 									<text class="tags sv" v-if="club.vipFlag == 1">SVIP</text>
 									<text class="tags xf" v-if="club.newDeal === 1">新分配</text>
 								</view>
-								<view class="list-ntel">
+								<view class="list-ntel" v-if="tabSmallCurrentIndex === 1">
+									<text class="list-link">销售:{{ club.serviceName ? club.serviceName : '' }}</text>
+								</view>
+								<view class="list-ntel" v-else>
 									<text class="list-link">{{ club.linkMan ? club.linkMan : '' }}</text>
 									<text class="list-texl">{{ club.contractMobile ? club.contractMobile : '' }}</text>
 								</view>
-								
 							</view>
 						</view>
 						<view class="list-cell-btn">
@@ -121,7 +123,7 @@
 									{{ showBadge(club.orderNum) }}
 								</text>
 							</view>
-							<view class="btn" @click.stop="handleReplaceClub(club)">更换协销</view>
+							<view class="btn" v-if="isManage && club.serviceProviderId != 1342" @click.stop="handleReplaceClub(club)">更换协销</view>
 							<view class="btn" @click.stop="handleClubinfo(club)" v-if="club.recordCount === 1"
 								>注册行为记录</view
 							>
@@ -149,6 +151,7 @@
 		<!-- 筛选抽屉 -->
 		<cm-clubDrawer
 			ref="screendrawer"
+			v-if="rightDrawer"
 			:rightDrawer="rightDrawer"
 			@handSearchConfirm="handSearchConfirmData"
 		>
@@ -165,6 +168,7 @@
 </template>
 
 <script>
+import { mapState, mapMutations } from 'vuex'	
 import authorize from '@/common/config/authorize.js'
 import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
 import tuiNomore from '@/components/tui-components/nomore/nomore'
@@ -178,9 +182,8 @@ const defaultListQuery = {
 	pageSize: 10,
 	spId: 0,
 	status: 90,
-	manager:0,
-	leaderId:0,
 	type:1,
+	groupServiceId:0
 	
 }
 export default {
@@ -218,15 +221,19 @@ export default {
 			salesParams: {
 				clubId: 0,
 				spId: 0
-			}
+			},
 		}
 	},
-	onLoad() {},
+	onLoad() {
+		console.log('isManage',this.isManage)
+	},
+	computed: {
+		...mapState(['isManage'])
+	},
 	methods: {
 		async initGetStotage() {
 			const userInfo = await this.$api.getStorage()
 			this.listQuery.spId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
-			this.listQuery.manager = userInfo.manager ? userInfo.manager : 0
 			this.GetSellerClubList()
 		},
 		GetSellerClubList() {
@@ -340,18 +347,21 @@ export default {
 					this.listQuery.type = 1
 					this.listQuery.status = 90
 					this.listQuery.pageNum = 1
+					this.listQuery.groupServiceId = 0
 					this.GetSellerClubList()
 					break
 				case 1:
 					this.listQuery.type = 2
 					this.listQuery.status = 90
 					this.listQuery.pageNum = 1
+					this.listQuery.groupServiceId = 0
 					this.GetSellerClubList()
 					break
 				case 2:
 					this.listQuery.type = 3
 					this.listQuery.status = 90
 					this.listQuery.pageNum = 1
+					this.listQuery.groupServiceId = 0
 					this.GetSellerClubList()
 					break
 			}
@@ -359,7 +369,7 @@ export default {
 		handSearchConfirmData(data) {
 			console.log('确定筛选', data)
 			//确定筛选
-			this.listQuery.startAddTime = data.startAddTime
+			this.listQuery.groupServiceId = data.serviceProviderId
 			this.GetSellerClubList()
 		},
 		handleChoiceaSellerData(data) {

+ 8 - 16
pages/seller/components/cm-club-drawer.vue

@@ -19,14 +19,14 @@
 								<picker
 									@change="bindPickerChange(1, $event)"
 									:value="index"
-									:range="priceActions"
+									:range="sellerActions"
 									range-key="name"
 								>
 									<input
 										class="input"
 										type="text"
 										disabled="false"
-										v-model="priceFlagText"
+										v-model="actionsText"
 										value=""
 										placeholder="请选择"
 									/>
@@ -63,19 +63,11 @@ export default {
 			drawerH: 0, // 抽屉内部scrollview高度
 			categorys: [],
 			checkedCategorysList: [],
-			priceFlagText: '',
+			actionsText: '',
 			queryData: {
-				endAddTime: '',
-				consult: '',
-				leaderId: 0,
-				groupId: 0,
-				newDeal: 0,
-				status: 0,
-				pinceSensitve: 0, //价格敏感度
-				satisfied: 0, // 意向程度
-				followup: 0 // 跟进状态
+				serviceProviderId: 0,
 			},
-			priceActions: []
+			sellerActions: []
 		}
 	},
 	created() {
@@ -89,7 +81,7 @@ export default {
 			const userInfo = await this.$api.getStorage()
 			this.SellerService.userSellerServiceTeam({ spId: userInfo.serviceProviderId })
 				.then(response => {
-					this.priceActions = response.data
+					this.sellerActions = response.data
 				})
 				.catch(error => {
 					console.log('=========>获取组员协销列表异常')
@@ -99,8 +91,8 @@ export default {
 			//选择筛选条件
 			switch (type) {
 				case 1:
-					this.priceFlagText = this.priceActions[e.target.value].name
-					this.queryData.pinceSensitve = this.priceActions[e.target.value].value
+					this.actionsText = this.sellerActions[e.target.value].name
+					this.queryData.serviceProviderId = this.sellerActions[e.target.value].serviceProviderId
 					break
 			}
 		},

+ 49 - 58
pages/seller/components/cm-order-drawer.vue

@@ -5,7 +5,10 @@
 			<view
 				class="drawer-container clearfix"
 				scroll-y
-				:style="{ paddingTop: (CustomBar-StatusBar+8) +'px', paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
+				:style="{
+					paddingTop: CustomBar - StatusBar + 8 + 'px',
+					paddingBottom: isIphoneX ? '180rpx' : '146rpx'
+				}"
 			>
 				<scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
 					<view class="drawer-title">更多筛选</view>
@@ -13,8 +16,20 @@
 						<view class="drawer-main-name">组员:</view>
 						<view class="drawer-main-radiov">
 							<view class="drawer-main-radio">
-								<picker @change="bindPickerChange(1,$event)" :value="index" :range="priceActions" range-key="name">
-									<input class="input" type="text" disabled="false" v-model="priceFlagText" value="" placeholder="请选择"/>
+								<picker
+									@change="bindPickerChange(1, $event)"
+									:value="index"
+									:range="sellerActions"
+									range-key="name"
+								>
+									<input
+										class="input"
+										type="text"
+										disabled="false"
+										v-model="actionsText"
+										value=""
+										placeholder="请选择"
+									/>
 									<text class="iconfont icon-xiangyou"></text>
 								</picker>
 							</view>
@@ -44,73 +59,49 @@ export default {
 			CustomBar: this.CustomBar, // 顶部导航栏高度
 			StatusBar: this.StatusBar,
 			isIphoneX: this.$store.state.isIphoneX,
-			manager:0,
-			leaderId:0,
+			manager: 0,
+			leaderId: 0,
 			height: 0,
-			drawerH: 0 ,// 抽屉内部scrollview高度
-			categorys:[],
-			checkedCategorysList:[],
-			priceFlagText:'',
-			queryData:{
-				endAddTime:'',
-				consult:'',
-				leaderId:0,
-				groupId:0,
-				newDeal:0,
-				status:0,
-				pinceSensitve:0,//价格敏感度
-				satisfied:0,// 意向程度
-				followup:0,// 跟进状态
+			drawerH: 0, // 抽屉内部scrollview高度
+			categorys: [],
+			checkedCategorysList: [],
+			actionsText: '',
+			queryData: {
+				serviceProviderId: 0
 			},
-			priceActions:[
-				{name:'全部',value:0},
-				{name:'敏感',value:1},
-				{name: '适中',value:2},
-				{name: '不敏感',value:3},
-				{name: '不明确',value:4}
-			],
+			sellerActions: []
 		}
 	},
 	created() {
 		this.SetScrollHeight()
-		this.getUserClubConsults()
+		this.userSellerServiceTeam()
 	},
 	computed: {},
 	methods: {
-		async getUserClubConsults() {
+		async userSellerServiceTeam() {
+			//获取组员协销列表
 			const userInfo = await this.$api.getStorage()
-			this.manager = userInfo.manager ? userInfo.manager : 0
-			this.leaderId = userInfo.leaderId ? userInfo.leaderId : 0
-			//查询咨询类别
-			this.UserService.getUserClubConsults()
+			this.SellerService.userSellerServiceTeam({ spId: userInfo.serviceProviderId })
 				.then(response => {
-					this.categorys = response.data.map((el, index) => {
-						el.isChecked = false
-						return el
-					})
-					if(this.manager > 0){
-						this.getUserClubTeams()
-					}
-					if(this.leaderId > 0){
-						this.getUserClubTeamsRroups(this.leaderId)
-					}
+					this.sellerActions = response.data
 				})
 				.catch(error => {
-					console.log('=========>获取咨询类别列表失败')
+					console.log('=========>获取组员协销列表异常')
 				})
 		},
-		bindPickerChange(type,e) {//选择筛选条件
-			switch(type){
+		bindPickerChange(type, e) {
+			//选择筛选条件
+			switch (type) {
 				case 1:
-					this.priceFlagText = this.priceActions[e.target.value].name
-					this.queryData.pinceSensitve = this.priceActions[e.target.value].value
+					this.actionsText = this.sellerActions[e.target.value].name
+					this.queryData.serviceProviderId = this.sellerActions[e.target.value].serviceProviderId
 					break
 			}
 		},
-		closeDrawer(){
+		closeDrawer() {
 			this.$parent.rightDrawer = false
 		},
-		handSearchConfirm(){
+		handSearchConfirm() {
 			//确定筛选
 			this.$emit('handSearchConfirm', this.queryData)
 			this.$parent.rightDrawer = false
@@ -139,7 +130,7 @@ export default {
 	padding: 80rpx 0;
 	overflow: hidden;
 	box-sizing: border-box;
-	background-color: #FFFFFF;
+	background-color: #ffffff;
 	.drawer-title {
 		width: 100%;
 		height: 72rpx;
@@ -158,7 +149,7 @@ export default {
 		height: auto;
 		box-sizing: border-box;
 		float: left;
-		.drawer-main-name{
+		.drawer-main-name {
 			width: 100%;
 			height: 80rpx;
 			line-height: 80rpx;
@@ -169,25 +160,25 @@ export default {
 			padding: 0 20rpx;
 			font-weight: bold;
 		}
-		.drawer-main-radiov{
+		.drawer-main-radiov {
 			width: 100%;
 			height: auto;
 			box-sizing: border-box;
 			padding: 0 20rpx;
-			.drawer-main-radio{
+			.drawer-main-radio {
 				width: 100%;
 				height: 80rpx;
 				box-sizing: border-box;
 				padding: 0 10rpx;
-				border: 1px solid rgba(0,0,0,0.2);
+				border: 1px solid rgba(0, 0, 0, 0.2);
 				border-radius: 6rpx;
 				margin-bottom: 30rpx;
 				position: relative;
-				&.btn{
+				&.btn {
 					border: none;
 					margin-top: 40rpx;
 				}
-				.input{
+				.input {
 					width: 100%;
 					height: 80rpx;
 					line-height: 80rpx;
@@ -198,7 +189,7 @@ export default {
 					padding: 0 10rpx;
 					padding-right: 68rpx;
 				}
-				.iconfont{
+				.iconfont {
 					width: 50rpx;
 					height: 80rpx;
 					display: block;
@@ -244,7 +235,7 @@ export default {
 				background: $btn-confirm;
 			}
 			&.clear {
-				background: #FFE6DC;
+				background: #ffe6dc;
 				color: $color-system;
 			}
 		}

+ 4 - 0
pages/seller/order/order-historylist.vue

@@ -210,6 +210,7 @@
 								<!-- 底部button -->
 								<order-button
 									ref="orderButton"
+									v-if="clubSpId === serviceProviderId"
 									:status="order.status"
 									:order = "order"
 									:rechargeGoods="order.rechargeGoods"
@@ -257,6 +258,7 @@
 </template>
 
 <script>
+import { mapState, mapMutations } from 'vuex'		
 import headerBack from '@/components/cm-module/headerNavbar/header-back' // 自定义顶部导航
 import btSearch from '@/components/uni-search/bt-search.vue' // 搜索
 import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
@@ -300,6 +302,7 @@ export default {
 			currentTab: 0, //预设当前项的值
 			screenTab: 0, //筛选预设当前项的值
 			scrollLeft: 0, //tab标题的滚动条位置
+			clubSpId:0, // 机构协销Id
 			serviceProviderId: 0, //协销用户ID
 			orderData: [],
 			btnClubUserID: 0,
@@ -350,6 +353,7 @@ export default {
 			const userInfo = await this.$api.getStorage()
 			this.clubId = clubInfo.clubId ? clubInfo.clubId : 0
 			this.userId = clubInfo.userId ? clubInfo.userId : 0
+			this.clubSpId = clubInfo.serviceProviderId
 			this.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
 			this.getOrderDatainit(this.currentTab)
 		},

+ 9 - 3
pages/seller/order/order-list.vue

@@ -7,7 +7,7 @@
 			:headerBtnPosi="headerBtnPosi"
 			:isDelete="isDelete"
 			:isUsertype="1"
-			:manager="manager"
+			:screenTab="screenTab"
 			@goSearchPath="handlSearchPath"
 		>
 		</header-back>
@@ -36,7 +36,7 @@
 				>
 				<view
 					class="tab-screen-item"
-					v-if="manager > 0"
+					v-if="isManage"
 					:data-current="3"
 					:class="[screenTab == 3 ? 'active' : '']"
 					@tap.stop="onClickScreenTab(3)"
@@ -233,6 +233,7 @@
 								<!-- 底部button -->
 								<order-button
 									ref="orderButton"
+									v-if="screenTab!=3"
 									:status="order.status"
 									:order="order"
 									:orderId="order.orderId"
@@ -288,6 +289,7 @@
 </template>
 
 <script>
+import { mapState, mapMutations } from 'vuex'		
 import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义顶部导航
 import btSearch from '@/components/uni-search/bt-search.vue' //搜索
 import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
@@ -383,6 +385,7 @@ export default {
 				self.winHeight = calc - self.CustomBar - 82
 			}
 		})
+		console.log('isManage',this.isManage)
 	},
 	filters: {
 		NumFormat(value) {
@@ -390,6 +393,9 @@ export default {
 			return Number(value).toFixed(2)
 		}
 	},
+	computed: {
+		...mapState(['isManage'])
+	},
 	methods: {
 		async initGetStotage() {
 			const userInfo = await this.$api.getStorage()
@@ -908,7 +914,7 @@ page {
 				color: #f0cb72;
 			}
 		}
-		.name{
+		.name {
 			float: right;
 			font-size: 26rpx;
 			color: #999999;

+ 9 - 1
store/index.js

@@ -20,7 +20,8 @@ const store = new Vuex.Store({
         isIphoneX: false,
         isActivity: false,
         isLoginType: 0,
-        isLoginProductId: 0
+        isLoginProductId: 0,
+        isManage: false,// 是否是管理员或者小组长
     },
     mutations: {
         login(state, provider) { //用户身份 1、协销 2、资质机构 3、供应商 4.个人机构
@@ -57,6 +58,13 @@ const store = new Vuex.Store({
             if (state.userInfo) {
                 state.clubType = provider.firstClubType
                 state.identity = provider.userIdentity
+                // 判断登录用户为协销 设置管理员组长权限
+                if(provider.userIdentity === 1){
+                    if(provider.manager>0 || provider.leaderId > 0){
+                        state.isManage = true
+                    }
+                }
+                // 判断以下公司账户设置部分权限
                 if (provider.userId == 5261 || provider.userId == 10947 || provider.userId == 11579) {
                     state.identity = 1
                 } else if (provider.firstClubType == 1) {