|
@@ -369,7 +369,7 @@ func (this *CompanyController) SearchList() {
|
|
|
|
|
|
btnItem := new(company.ButtonPermission)
|
|
|
if item.CompanyId != 1 {
|
|
|
- *btnItem = services.GetCompanyPermissionButton(roleTypeCode, itemStatus, item.SellerIds, item.GroupIds, item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, item.ShareSellerId)
|
|
|
+ *btnItem = services.GetCompanyPermissionButton(roleTypeCode, itemStatus, item.SellerIds, item.GroupIds, item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, -1, item.ShareSellerIds)
|
|
|
//根据销售"领取客户"的权限对部分按钮做限制
|
|
|
btnItem = services.GetCompanyPermissionButtonByReceiveEnabled(btnItem, receiveEnabled)
|
|
|
}
|
|
@@ -1317,7 +1317,7 @@ func (this *CompanyController) List() {
|
|
|
//按钮显示控制
|
|
|
btnItem := new(company.ButtonPermission)
|
|
|
if item.CompanyId != 1 {
|
|
|
- *btnItem = services.GetCompanyPermissionButton(roleTypeCode, itemStatus, item.GroupIds, item.GroupIds, item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, item.ShareSellerId)
|
|
|
+ *btnItem = services.GetCompanyPermissionButton(roleTypeCode, itemStatus, item.GroupIds, item.GroupIds, item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, -1, item.ShareSellerIds)
|
|
|
//根据销售"领取客户"的权限对部分按钮做限制
|
|
|
btnItem = services.GetCompanyPermissionButtonByReceiveEnabled(btnItem, receiveEnabled)
|
|
|
}
|
|
@@ -1591,7 +1591,7 @@ func (this *CompanyController) List() {
|
|
|
//viewTotal:=GetviewTotal(v.CompanyId)
|
|
|
|
|
|
//活跃(客户状态)
|
|
|
- if v.IsShare != 1 {
|
|
|
+ if v.IsShare != 1 {
|
|
|
if v.BtnItem.BtnModifySeller == true {
|
|
|
v.BtnItem.BtnModifySeller = false
|
|
|
}
|
|
@@ -1745,13 +1745,20 @@ func (this *CompanyController) List() {
|
|
|
IsShare: v.IsShare,
|
|
|
CloseTime: v.CloseTime,
|
|
|
CloseReason: v.CloseReason,
|
|
|
- ShareSeller: v.ShareSeller,
|
|
|
- ShareSellerId: v.ShareSellerId,
|
|
|
- }
|
|
|
- if v.ShareSellerId != 0 {
|
|
|
- shareSeller := adminMap[v.ShareSellerId]
|
|
|
- if shareSeller != nil {
|
|
|
- companyList.ShareSeller = shareSeller.RealName + "(" + shareSeller.GroupName + ")"
|
|
|
+ ShareSellerIds: v.ShareSellerIds,
|
|
|
+ }
|
|
|
+ if v.ShareSellerIds != "" {
|
|
|
+ shareSellerIds := strings.Split(v.ShareSellerIds, ",")
|
|
|
+ for _, idStr := range shareSellerIds {
|
|
|
+ shareSellerId ,e:= strconv.Atoi(idStr)
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ return
|
|
|
+ }
|
|
|
+ shareSeller := adminMap[shareSellerId]
|
|
|
+ if shareSeller != nil {
|
|
|
+ companyList.ShareSeller += shareSeller.RealName + "(" + shareSeller.GroupName + ")"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
companyLists = append(companyLists, companyList)
|
|
@@ -3081,7 +3088,7 @@ func (this *CompanyController) Detail() {
|
|
|
shareSellerId := 0
|
|
|
var productItem *company.CompanyProduct
|
|
|
if productId > 0 {
|
|
|
- var e error
|
|
|
+ var e error
|
|
|
productItem, e = company.GetCompanyProductByCompanyIdAndProductId(companyId, productId)
|
|
|
if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "客户信息有误"
|
|
@@ -3335,7 +3342,7 @@ func (this *CompanyController) Detail() {
|
|
|
resp.IsButtonShow = 1
|
|
|
}
|
|
|
}
|
|
|
- btnItem := services.GetCompanyPermissionButton(roleTypeCode, item.Status, strconv.Itoa(item.SellerId), strconv.Itoa(item.GroupId), item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, shareSellerId)
|
|
|
+ btnItem := services.GetCompanyPermissionButton(roleTypeCode, item.Status, strconv.Itoa(item.SellerId), strconv.Itoa(item.GroupId), item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, shareSellerId, "")
|
|
|
//if itemLen > 1 {
|
|
|
// btnDetailItem.BtnEdit = false
|
|
|
// btnDetailItem.BtnDelete = false
|
|
@@ -3705,7 +3712,7 @@ func (this *CompanyController) DetailByCreditCode() {
|
|
|
}
|
|
|
}
|
|
|
btnItem := services.GetCompanyPermissionButton(roleTypeCode, item.Status, strconv.Itoa(item.SellerId), strconv.Itoa(item.GroupId),
|
|
|
- item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, item.ShareSellerId)
|
|
|
+ item.GroupId, sysUser.GroupId, item.SellerId, sysUser.AdminId, sysUser.Authority, item.ProductId, item.ShareSellerId, "")
|
|
|
//if itemLen > 1 {
|
|
|
// btnDetailItem.BtnEdit = false
|
|
|
// btnDetailItem.BtnDelete = false
|