|
@@ -867,12 +867,20 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
if !strings.Contains(status, "/") {
|
|
if !strings.Contains(status, "/") {
|
|
if status == utils.COMPANY_STATUS_FORMAL { //正式
|
|
if status == utils.COMPANY_STATUS_FORMAL { //正式
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ if productId == utils.COMPANY_PRODUCT_RAI_ID {
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ } else {
|
|
|
|
+ button.BtnRemarkView = true
|
|
|
|
+ }
|
|
return
|
|
return
|
|
} else if status == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
} else if status == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
button.BtnEdit = true
|
|
button.BtnEdit = true
|
|
button.BtnDelete = true
|
|
button.BtnDelete = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ if productId == utils.COMPANY_PRODUCT_RAI_ID {
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ } else {
|
|
|
|
+ button.BtnRemarkView = true
|
|
|
|
+ }
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
button.BtnFreeze = false
|
|
button.BtnFreeze = false
|
|
if productId == utils.COMPANY_PRODUCT_FICC_ID {
|
|
if productId == utils.COMPANY_PRODUCT_FICC_ID {
|
|
@@ -881,11 +889,18 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
return
|
|
return
|
|
} else if status == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
} else if status == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ if productId == utils.COMPANY_PRODUCT_RAI_ID {
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ } else {
|
|
|
|
+ button.BtnRemarkView = true
|
|
|
|
+ }
|
|
return
|
|
return
|
|
} else if status == utils.COMPANY_STATUS_LOSE { //流失
|
|
} else if status == utils.COMPANY_STATUS_LOSE { //流失
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
button.BtnDelete = true
|
|
button.BtnDelete = true
|
|
|
|
+ if productId == utils.COMPANY_PRODUCT_RAI_ID {
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ }
|
|
return
|
|
return
|
|
} else if status == utils.COMPANY_STATUS_CLOSE { // 关闭
|
|
} else if status == utils.COMPANY_STATUS_CLOSE { // 关闭
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
@@ -898,6 +913,9 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
//button.BtnModifySeller = true
|
|
//button.BtnModifySeller = true
|
|
button.BtnDelete = true
|
|
button.BtnDelete = true
|
|
button.BtnEdit = true
|
|
button.BtnEdit = true
|
|
|
|
+ if productId == utils.COMPANY_PRODUCT_RAI_ID {
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ }
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -949,6 +967,7 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
if productStatus == utils.COMPANY_STATUS_FORMAL { //正式
|
|
if productStatus == utils.COMPANY_STATUS_FORMAL { //正式
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
button.BtnShare = true
|
|
button.BtnShare = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
button.BtnEdit = true
|
|
button.BtnEdit = true
|
|
//button.BtnDelete = true
|
|
//button.BtnDelete = true
|
|
@@ -956,13 +975,17 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
button.BtnFreeze = false
|
|
button.BtnFreeze = false
|
|
// CRM14.7.2 权益管理员可以设置试用客户为共享
|
|
// CRM14.7.2 权益管理员可以设置试用客户为共享
|
|
button.BtnShare = true
|
|
button.BtnShare = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
//button.BtnDelete = true
|
|
//button.BtnDelete = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else { //永续
|
|
} else { //永续
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
button.BtnShare = true
|
|
button.BtnShare = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
productStatus2, hasProduct2 := productStatusMap[1]
|
|
productStatus2, hasProduct2 := productStatusMap[1]
|
|
@@ -1163,7 +1186,8 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
//button.BtnShare = true
|
|
//button.BtnShare = true
|
|
button.BtnRemarkEdit = true
|
|
button.BtnRemarkEdit = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ //button.BtnRemarkView = true //权益销售隐藏
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
button.BtnEdit = true
|
|
button.BtnEdit = true
|
|
button.BtnDelete = true
|
|
button.BtnDelete = true
|
|
@@ -1173,7 +1197,8 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
button.BtnFreeze = true
|
|
button.BtnFreeze = true
|
|
button.BtnRemarkEdit = true
|
|
button.BtnRemarkEdit = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ //button.BtnRemarkView = true //权益销售隐藏
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
//button.BtnShare = true
|
|
//button.BtnShare = true
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
button.BtnThaw = true
|
|
button.BtnThaw = true
|
|
@@ -1182,12 +1207,15 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
button.BtnRemarkView = true
|
|
button.BtnRemarkView = true
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
button.BtnApplyReceive = true
|
|
button.BtnApplyReceive = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_FOREVER { //永续
|
|
} else if productStatus == utils.COMPANY_STATUS_FOREVER { //永续
|
|
button.BtnTurnPositive = true
|
|
button.BtnTurnPositive = true
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
button.BtnView = true //显示权限、详情
|
|
button.BtnView = true //显示权限、详情
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
//如果不是自己客户,那么判断是否是本小组的,如果是本小组,那么还是申请领取,非本小组的话,那就是领取
|
|
//如果不是自己客户,那么判断是否是本小组的,如果是本小组,那么还是申请领取,非本小组的话,那就是领取
|
|
if groupId == sysUserGroupId {
|
|
if groupId == sysUserGroupId {
|
|
button.BtnApplyReceive = true
|
|
button.BtnApplyReceive = true
|
|
@@ -1201,25 +1229,31 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
|
|
//如果是组长,且该客户属于本组客户
|
|
//如果是组长,且该客户属于本组客户
|
|
if authority == 2 && hasGroupId && groupId == sysUserGroupId {
|
|
if authority == 2 && hasGroupId && groupId == sysUserGroupId {
|
|
button.BtnView = true //查看详情权限
|
|
button.BtnView = true //查看详情权限
|
|
|
|
+ button.BtnRemarkViewHistory = true //历史备注
|
|
if productStatus == utils.COMPANY_STATUS_FORMAL { //正式
|
|
if productStatus == utils.COMPANY_STATUS_FORMAL { //正式
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
//button.BtnShare = true
|
|
//button.BtnShare = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ //button.BtnRemarkView = true //权益销售隐藏
|
|
|
|
+ //button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ //button.BtnRemarkView = true //权益销售隐藏
|
|
|
|
+ //button.BtnRemarkViewHistory = true
|
|
//button.BtnShare = true
|
|
//button.BtnShare = true
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
|
|
button.BtnModifySeller = true
|
|
button.BtnModifySeller = true
|
|
- button.BtnRemarkView = true
|
|
|
|
|
|
+ //button.BtnRemarkView = true //权益销售隐藏
|
|
|
|
+ //button.BtnRemarkViewHistory = true
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
|
|
if sellerId == sysUserId || groupId == sysUserGroupId || utils.InArrayByStr(shareSellerIdArr, strconv.Itoa(sysUserId)) || shareSellerId == sysUserId {
|
|
if sellerId == sysUserId || groupId == sysUserGroupId || utils.InArrayByStr(shareSellerIdArr, strconv.Itoa(sysUserId)) || shareSellerId == sysUserId {
|
|
button.BtnApplyReceive = true
|
|
button.BtnApplyReceive = true
|
|
} else {
|
|
} else {
|
|
button.BtnReceive = true
|
|
button.BtnReceive = true
|
|
}
|
|
}
|
|
|
|
+ //button.BtnRemarkViewHistory = true
|
|
} else { //永续
|
|
} else { //永续
|
|
//button.BtnDelete = true
|
|
//button.BtnDelete = true
|
|
|
|
+ //button.BtnRemarkViewHistory = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2389,6 +2423,7 @@ func FilterReadAndContractAuth(chartPermissions, contractPermissions, condition
|
|
|
|
|
|
// GetShareCompanyPermissionButton 正式客户共享-权限按钮
|
|
// GetShareCompanyPermissionButton 正式客户共享-权限按钮
|
|
func GetShareCompanyPermissionButton(roleTypeCode, statuses string, productId int, item *company.CompanyItem, sysUser *system.Admin) (button *company.ButtonPermission) {
|
|
func GetShareCompanyPermissionButton(roleTypeCode, statuses string, productId int, item *company.CompanyItem, sysUser *system.Admin) (button *company.ButtonPermission) {
|
|
|
|
+ statuses = strings.Replace(statuses, "(共享)", "", -1)
|
|
statusMap := make(map[int]string)
|
|
statusMap := make(map[int]string)
|
|
statusMap[productId] = statuses
|
|
statusMap[productId] = statuses
|
|
if strings.Contains(statuses, "/") {
|
|
if strings.Contains(statuses, "/") {
|
|
@@ -2470,5 +2505,16 @@ func GetShareCompanyPermissionButton(roleTypeCode, statuses string, productId in
|
|
if companyButton.BtnShare == true {
|
|
if companyButton.BtnShare == true {
|
|
button.BtnShare = true
|
|
button.BtnShare = true
|
|
}
|
|
}
|
|
|
|
+ //备注与历史备注修改 CRM15.9.1
|
|
|
|
+ button.BtnRemarkView = companyButton.BtnRemarkView
|
|
|
|
+
|
|
|
|
+ if productId == 2 {
|
|
|
|
+ button.BtnRemarkView = false
|
|
|
|
+ button.BtnRemarkViewHistory = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if utils.InArrayByStr([]string{utils.ROLE_TYPE_CODE_RAI_ADMIN, utils.ROLE_TYPE_CODE_RAI_SELLER, utils.ROLE_TYPE_CODE_RAI_GROUP}, roleTypeCode) {
|
|
|
|
+ button.BtnServiceRecord = false //王芳,权益销售,权益销售组长,这三种身份看不到这个按钮
|
|
|
|
+ }
|
|
return
|
|
return
|
|
}
|
|
}
|