feat: 全项目列表页操作列规范统一 + 问题.md 六条整改

- 操作列按6条标准统一(WMS 13页/MES 18页):fixed right、宽160超限折更多、一列一填充、危险操作link+二次确认置末、页面级新建移工具栏
- 修复MES物料档案启用报错:改走 POST /product-types/status 专用端点,不再被全字段必填校验拦截
- 附件归档清理由按年改为用户选月(精确到月,截止月最晚6个月前,默认当前月-6),前后端同步
- 序列号文案统一为「是=逐件录SN,否=按数量(不录SN)」,MES 下拉改单选框
- 入库货架/层/位置必填校验(InboundEntry 前端 + inbound.go 后端),杜绝有区域无货架的新脏数据
- 生产流程卡新增列表Tab(新接口 GET /process-card/list 分页),去掉筛选默认时间
- 清理遗留 assets_bak/public_bak 备份目录;更新 WMS/MES 前端构建产物(index.html)
This commit is contained in:
SunYF
2026-10-10 18:09:17 +08:00
parent f6a26256c5
commit 56d56648f9
224 changed files with 687 additions and 1874 deletions
@@ -7,6 +7,7 @@ import (
"html/template"
"net/http"
"sort"
"strconv"
"strings"
"time"
@@ -261,6 +262,51 @@ func ModelWorkOrdersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
}
// ProcessCardListHandler GET /process-card/list 流程卡列表(分页)。
// 每个工单=一张生产流程卡;不要求任何查询条件即可返回全部(分页),解决旧版「必须知道查谁才能查」看不到全量流程卡的问题。
// 支持 orderNo / productCode / keyword(工单号·产品编码·产品名称)筛选;返回 {list, total}。
func ProcessCardListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
page, _ := strconv.Atoi(q.Get("page"))
pageSize, _ := strconv.Atoi(q.Get("pageSize"))
if page < 1 {
page = 1
}
if pageSize < 1 {
pageSize = 20
}
if pageSize > 200 {
pageSize = 200
}
total, list, err := logic.New(svcCtx).ListProcessCards(r.Context(), page, pageSize,
strings.TrimSpace(q.Get("orderNo")), strings.TrimSpace(q.Get("productCode")), strings.TrimSpace(q.Get("keyword")))
if err != nil {
httpx.Fail(w, 2409, err.Error())
return
}
rows := make([]map[string]any, 0, len(list))
for _, wo := range list {
createdAt := ""
if !wo.CreatedAt.IsZero() {
createdAt = wo.CreatedAt.Format("2006-01-02 15:04")
}
rows = append(rows, map[string]any{
"id": wo.ID,
"workOrderNo": wo.WorkOrderNo,
"productCode": wo.ProductCode,
"productName": wo.ProductName,
"productSerial": wo.ProductSerial,
"status": wo.Status,
"planQty": wo.Quantity,
"finishedNum": wo.FinishedNum,
"createdAt": createdAt,
})
}
httpx.Ok(w, map[string]any{"list": rows, "total": total})
}
}
// ============================================================================
// 数据聚合
// ============================================================================
@@ -309,6 +309,7 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
{Method: http.MethodGet, Path: "/process-card/workorder", Handler: WorkOrderCardHandler(serverCtx)},
{Method: http.MethodGet, Path: "/process-card/by-sn", Handler: SnTraceCardHandler(serverCtx)},
{Method: http.MethodGet, Path: "/process-card/by-model", Handler: ModelWorkOrdersHandler(serverCtx)},
{Method: http.MethodGet, Path: "/process-card/list", Handler: ProcessCardListHandler(serverCtx)},
// ---------- 工艺物料清单(flow_material,一份工艺定义一份清单) ----------
{Method: http.MethodGet, Path: "/process-flows/:id/materials", Handler: production.ListFlowMaterialsHandler(serverCtx)},