1、系统列表优化,导出excel增加小程序ID展示;
2、零售明细优化,解决删除用户后导出excel销售员为空的问题;
This commit is contained in:
parent
54eb867d40
commit
6d9004e27d
|
@ -1920,7 +1920,9 @@ func (m *ErpOrder) SetOrderSalesmanAI(erpCommodityMap map[uint32]ErpCommodity, s
|
|||
|
||||
// 获取员工毛利
|
||||
userInfo := userMap[item.Uid]
|
||||
item.Name = userInfo.NickName
|
||||
if userInfo.UserId != 0 {
|
||||
item.Name = userInfo.NickName
|
||||
}
|
||||
item.SalesmanPer = totalStaffProfit * userInfo.SalesCommRate * 0.01 / float64(len(salesmanInfo))
|
||||
|
||||
salesmanList = append(salesmanList, item)
|
||||
|
|
|
@ -440,7 +440,7 @@ func sysUserExport(req []SysUserPage) (string, error) {
|
|||
fmt.Println("url fileName:", url+fileName)
|
||||
|
||||
// 组合标题栏数据
|
||||
title := []interface{}{"用户名称", "用户昵称", "角色", "合作商", "门店", "手机号", "店员识别码", "状态"}
|
||||
title := []interface{}{"用户名称", "用户昵称", "角色", "合作商", "门店", "手机号", "店员识别码", "状态", "小程序账号ID"}
|
||||
for i, _ := range title {
|
||||
cell, _ := excelize.CoordinatesToCellName(1+i, 1)
|
||||
err := file.SetCellValue(fSheet, cell, title[i])
|
||||
|
@ -473,6 +473,13 @@ func sysUserExport(req []SysUserPage) (string, error) {
|
|||
status = "停用"
|
||||
}
|
||||
|
||||
var userUid string
|
||||
if userData.UserId == 0 {
|
||||
userUid = ""
|
||||
} else {
|
||||
userUid = tools.IntToString(int(userData.Uid))
|
||||
}
|
||||
|
||||
row = []interface{}{
|
||||
userData.UserName.Username, // 用户名称
|
||||
userData.NickName, // 用户昵称
|
||||
|
@ -482,6 +489,7 @@ func sysUserExport(req []SysUserPage) (string, error) {
|
|||
userData.Phone, // 手机号
|
||||
userData.ShopperCode, // 店员识别码
|
||||
status, // 状态
|
||||
userUid, // 用户UID
|
||||
}
|
||||
|
||||
for j, _ := range row {
|
||||
|
@ -518,8 +526,9 @@ func sysUserExport(req []SysUserPage) (string, error) {
|
|||
file.SetColWidth("Sheet1", "E", "E", 30)
|
||||
file.SetColWidth("Sheet1", "F", "F", 15)
|
||||
file.SetColWidth("Sheet1", "G", "G", 15)
|
||||
file.SetColWidth("Sheet1", "I", "I", 15)
|
||||
|
||||
endRow := fmt.Sprintf("H"+"%d", nExcelStartRow+2)
|
||||
endRow := fmt.Sprintf("I"+"%d", nExcelStartRow+2)
|
||||
// 应用样式到整个表格
|
||||
_ = file.SetCellStyle("Sheet1", "A1", endRow, style)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user