zwxi 11 months ago
parent
commit
ba9a7a7ffb
3 changed files with 21 additions and 22 deletions
  1. 5 5
      controllers/company.go
  2. 14 14
      controllers/company_share.go
  3. 2 3
      services/company.go

+ 5 - 5
controllers/company.go

@@ -1595,11 +1595,11 @@ func (this *CompanyController) List() {
 			//viewTotal:=GetviewTotal(v.CompanyId)
 
 			//活跃(客户状态)
-			if v.IsShare != 1 {
-				if v.BtnItem.BtnModifySeller == true {
-					v.BtnItem.BtnModifySeller = false
-				}
-			}
+			//if v.IsShare != 1 {
+			//	if v.BtnItem.BtnModifySeller == true {
+			//		v.BtnItem.BtnModifySeller = false
+			//	}
+			//}
 			//productIdSlice := strings.Split(v.ProductIds, "/")
 			//statusSlice := strings.Split(v.Status, "/")
 			//for productIndex, tmpProductId := range productIdSlice {

+ 14 - 14
controllers/company_share.go

@@ -212,31 +212,31 @@ func (this *CompanyController) CompanyShareList() {
 				if sysUser.GroupId == groupId {
 					condition += ` AND b.share_seller_id=? `
 					pars = append(pars, sysUser.AdminId)
+				} else {
+					// 在此页面销售只能看分配给自己的客户
+					condition += ` AND (b.seller_id =? OR b.share_seller_id =? )`
+					pars = append(pars, sysUser.AdminId, sysUser.AdminId)
 				}
-				// 在此页面销售只能看分配给自己的客户
-				//else {
-				//	condition += ` AND b.seller_id=? `
-				//	pars = append(pars, sysUser.AdminId)
-				//}
 			}
 		}
 	}
 
+
 	if listParam == 0 {
 		if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_SELLER || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_GROUP ||
 			sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_TEAM || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_SELLER ||
-			sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_GROUP{
+			sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_GROUP {
 			//非咨询组销售,那么默认查看“未共享”的客户
 			if sysUser.GroupId != groupId {
 				listParam = 3
-				if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_SELLER || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_SELLER{
+				if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_SELLER || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_SELLER {
 					condition += ` AND b.seller_id = ? `
 					pars = append(pars, sysUser.AdminId)
 				}
 			} else {
 				condition += ` AND b.is_share=1 `
 			}
-		} else if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_ADMIN || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_ADMIN || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_ADMIN{
+		} else if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_ADMIN || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_ADMIN || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_RAI_ADMIN {
 			// 管理员,默认查看“待分配”客户
 			listParam = 2
 		}
@@ -249,7 +249,7 @@ func (this *CompanyController) CompanyShareList() {
 	} else if listParam == 3 { // 未共享
 		if productId == 1 {
 			condition += ` AND b.is_share=0 and (b.status="正式" AND b.product_id = 1) `
-		} else if productId == 2{
+		} else if productId == 2 {
 			condition += ` AND b.is_share=0 and (b.status IN ("正式","试用") AND b.product_id = 2) `
 		} else {
 			condition += ` AND b.is_share=0 and ((b.status="正式" AND b.product_id = 1) OR (b.status IN ("正式","试用") AND b.product_id = 2))`
@@ -581,7 +581,7 @@ func (this *CompanyController) CompanyShareList() {
 			//viewTotal:=GetviewTotal(v.CompanyId)
 
 			//活跃(客户状态)
-			if v.IsShare != 1  {
+			if v.IsShare != 1 {
 				if v.BtnItem.BtnModifySeller == true {
 					v.BtnItem.BtnModifySeller = false
 				}
@@ -654,7 +654,7 @@ func (this *CompanyController) CompanyShareList() {
 			if v.ShareSellerIds != "" {
 				shareSellerIds := strings.Split(v.ShareSellerIds, ",")
 				for _, idStr := range shareSellerIds {
-					shareSellerId ,e:= strconv.Atoi(idStr)
+					shareSellerId, e := strconv.Atoi(idStr)
 					if e != nil {
 						err = e
 						return
@@ -740,7 +740,7 @@ func (this *CompanyController) MoveShareSeller() {
 		return
 	}
 	//查询该客户
-	companyProductItem, err := company.GetCompanyProductByCompanyIdAndProductId(req.CompanyId,productId)
+	companyProductItem, err := company.GetCompanyProductByCompanyIdAndProductId(req.CompanyId, productId)
 	if err != nil {
 		br.Msg = "查找客户失败"
 		br.ErrMsg = "查找客户失败,Err:" + err.Error()
@@ -1061,7 +1061,7 @@ func (this *CompanyController) CompanyShareListByCity() {
 			//viewTotal:=GetviewTotal(v.CompanyId)
 
 			//活跃(客户状态)
-			if v.IsShare != 1  {
+			if v.IsShare != 1 {
 				if v.BtnItem.BtnModifySeller == true {
 					v.BtnItem.BtnModifySeller = false
 				}
@@ -1129,7 +1129,7 @@ func (this *CompanyController) CompanyShareListByCity() {
 			if v.ShareSellerIds != "" {
 				shareSellerIds := strings.Split(v.ShareSellerIds, ",")
 				for _, idStr := range shareSellerIds {
-					shareSellerId ,e:= strconv.Atoi(idStr)
+					shareSellerId, e := strconv.Atoi(idStr)
 					if e != nil {
 						err = e
 						return

+ 2 - 3
services/company.go

@@ -1150,7 +1150,7 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
 						button.BtnUpdate = true
 						button.BtnTryOut = true
 						button.BtnModifySeller = true
-						button.BtnShare = true
+						//button.BtnShare = true
 						button.BtnRemarkEdit = true
 						button.BtnRemarkView = true
 					} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
@@ -1163,8 +1163,7 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
 						button.BtnFreeze = true
 						button.BtnRemarkEdit = true
 						button.BtnRemarkView = true
-						// CRM14.7.2 权益管理员可以设置试用客户为共享
-						button.BtnShare = true
+						//button.BtnShare = true
 					} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
 						button.BtnThaw = true
 						button.BtnModifySeller = true