feat(outbound)为出库单查询和导出功能添加入库归属单号筛选条件
- 更新前端页面表单,新增归属单号搜索框并绑定对应参数 - 调整后端查询代码中归属单号过滤条件的位置,优化可读性
This commit is contained in:
@@ -333,15 +333,15 @@ func queryOutboundHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
if boxNo != "" {
|
||||
q = q.Where(outboundorder.BoxNoContainsFold(boxNo))
|
||||
}
|
||||
if ownershipNo != "" {
|
||||
q = q.Where(outboundorder.OwnershipNoContainsFold(ownershipNo))
|
||||
}
|
||||
if outboundType != "" {
|
||||
q = q.Where(outboundorder.OutboundTypeEQ(outboundType))
|
||||
}
|
||||
if outboundCategory != "" {
|
||||
q = q.Where(outboundorder.OutboundCategoryEQ(outboundCategory))
|
||||
}
|
||||
if ownershipNo != "" {
|
||||
q = q.Where(outboundorder.OwnershipNoContainsFold(ownershipNo))
|
||||
}
|
||||
if materialName != "" {
|
||||
q = q.Where(outboundorder.MaterialNameContainsFold(materialName))
|
||||
}
|
||||
@@ -628,7 +628,7 @@ func snListJSON(sn []string) string {
|
||||
}
|
||||
|
||||
// exportOutboundHandler 统一主表全部出库记录导出
|
||||
// 不依赖前端分页,一次返回全部(可按类型/工单/物料/箱号过滤),便于整表导出。
|
||||
// 不依赖前端分页,一次返回全部(可按类型/工单/物料/箱号/归属单号过滤),便于整表导出。
|
||||
func exportOutboundHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
outboundType := r.URL.Query().Get("outboundType")
|
||||
@@ -636,6 +636,7 @@ func exportOutboundHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
orderNo := r.URL.Query().Get("orderNo")
|
||||
materialCode := r.URL.Query().Get("materialCode")
|
||||
boxNo := r.URL.Query().Get("boxNo")
|
||||
ownershipNo := r.URL.Query().Get("ownershipNo")
|
||||
startDate, endDate, rerr := normalizeExportRange(r.URL.Query().Get("startDate"), r.URL.Query().Get("endDate"))
|
||||
if rerr != nil {
|
||||
fail(w, http.StatusBadRequest, rerr.Error())
|
||||
@@ -660,6 +661,9 @@ func exportOutboundHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
if boxNo != "" {
|
||||
q = q.Where(outboundorder.BoxNoContainsFold(boxNo))
|
||||
}
|
||||
if ownershipNo != "" {
|
||||
q = q.Where(outboundorder.OwnershipNoContainsFold(ownershipNo))
|
||||
}
|
||||
|
||||
list, err := q.Order(ent.Desc("created_at"), ent.Desc("id")).All(ctx0())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user