feat:多项功能优化
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
"bj_power_wms/ent/material"
|
||||
"bj_power_wms/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/xuri/excelize/v2"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
// itemTypeLabel 物料品类标签:1原材料/2半成品/3成品/4其他(辅料/工装/试验设备)
|
||||
@@ -171,6 +171,9 @@ func queryMaterialsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
spec := r.URL.Query().Get("spec")
|
||||
manageMode := atoi(r.URL.Query().Get("manageMode"), 0)
|
||||
itemType := atoi(r.URL.Query().Get("itemType"), 0)
|
||||
// 排除品类:入库各页签按管理粒度过滤时,需把「其他」品类(item_type=4)排除,
|
||||
// 否则档案里选「其他」时 manage_mode 保留默认值 1,会漏进结构件入库的下拉。
|
||||
excludeItemType := atoi(r.URL.Query().Get("excludeItemType"), 0)
|
||||
startDate := r.URL.Query().Get("startDate")
|
||||
endDate := r.URL.Query().Get("endDate")
|
||||
keyword := r.URL.Query().Get("keyword") // 仅供下拉选择框(MaterialSelect)远程搜索:编码/名称任一匹配;列表页禁用此混搜模式
|
||||
@@ -191,6 +194,9 @@ func queryMaterialsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
if itemType != 0 {
|
||||
q = q.Where(material.ItemTypeEQ(itemType))
|
||||
}
|
||||
if excludeItemType != 0 {
|
||||
q = q.Where(material.ItemTypeNEQ(excludeItemType))
|
||||
}
|
||||
if keyword != "" {
|
||||
q = q.Where(
|
||||
material.Or(
|
||||
|
||||
Reference in New Issue
Block a user