{
  "$schema": "https://www.ai-dc.ai/developer/schemas/aidc-ui.schema.json",
  "aidcUi": "1.0",
  "title": "库存与补货",
  "body": [
    {
      "type": "PageHeader",
      "title": "库存与补货",
      "description": "3 个仓 · 1,284 个 SKU · 数据截至今天 07:00",
      "actions": [
        {
          "label": "创建补货单",
          "name": "replenish.create"
        }
      ]
    },
    {
      "type": "Stats",
      "items": [
        {
          "label": "SKU",
          "value": 1284,
          "hint": "3 个仓"
        },
        {
          "label": "库存金额",
          "value": "¥2,460",
          "unit": "万",
          "delta": "-3.4%",
          "tone": "good",
          "hint": "比上月"
        },
        {
          "label": "低于安全库存",
          "value": 7,
          "unit": "个",
          "delta": "+2",
          "tone": "bad",
          "hint": "3 个 5 天内用完"
        },
        {
          "label": "在途",
          "value": "¥186",
          "unit": "万",
          "hint": "4 张采购单"
        }
      ]
    },
    {
      "type": "Proposal",
      "kind": "Adis 草拟",
      "title": "补货单 RQ-1029：3 个 SKU",
      "summary": "按近 30 天用量和 7 天交期算的建议量；供应商用上次中标的。提交后走采购审批。",
      "items": [
        {
          "label": "SKU",
          "value": "涤纶长丝 75D、包装纸箱 L、拉链 5#"
        },
        {
          "label": "金额",
          "value": "¥318,600"
        },
        {
          "label": "预计到货",
          "value": "10-18"
        }
      ],
      "confirm": {
        "label": "提交审批",
        "name": "replenish.submit",
        "payload": {
          "id": "RQ-1029"
        }
      },
      "cancel": {
        "label": "改一改",
        "name": "replenish.edit",
        "payload": {
          "id": "RQ-1029"
        }
      }
    },
    {
      "type": "Card",
      "title": "低于安全库存",
      "description": "按可用天数排",
      "children": [
        {
          "type": "Table",
          "columns": [
            {
              "key": "sku",
              "label": "SKU"
            },
            {
              "key": "name",
              "label": "名称"
            },
            {
              "key": "store",
              "label": "仓库"
            },
            {
              "key": "qty",
              "label": "在库",
              "kind": "number"
            },
            {
              "key": "safety",
              "label": "安全库存",
              "kind": "number"
            },
            {
              "key": "days",
              "label": "可用",
              "kind": "badge"
            },
            {
              "key": "suggest",
              "label": "建议补货",
              "kind": "number"
            }
          ],
          "rows": [
            {
              "sku": "RM-0751",
              "name": "涤纶长丝 75D",
              "store": "原料仓",
              "qty": 3.2,
              "safety": 8,
              "days": {
                "text": "4 天",
                "tone": "bad"
              },
              "suggest": 20
            },
            {
              "sku": "PK-0012",
              "name": "包装纸箱 L",
              "store": "辅料仓",
              "qty": 860,
              "safety": 2000,
              "days": {
                "text": "5 天",
                "tone": "bad"
              },
              "suggest": 5000
            },
            {
              "sku": "AC-0505",
              "name": "拉链 5#",
              "store": "辅料仓",
              "qty": 2400,
              "safety": 5000,
              "days": {
                "text": "5 天",
                "tone": "bad"
              },
              "suggest": 12000
            },
            {
              "sku": "RM-1503",
              "name": "棉纱 40S",
              "store": "原料仓",
              "qty": 6.5,
              "safety": 9,
              "days": {
                "text": "9 天",
                "tone": "warning"
              },
              "suggest": 10
            },
            {
              "sku": "AC-0218",
              "name": "织带 25mm",
              "store": "辅料仓",
              "qty": 3100,
              "safety": 4000,
              "days": {
                "text": "11 天",
                "tone": "warning"
              },
              "suggest": 6000
            }
          ],
          "caption": "在库与建议补货的单位：原料是吨，辅料是个或米。"
        }
      ]
    },
    {
      "type": "Grid",
      "children": [
        {
          "type": "Card",
          "title": "库存金额按品类",
          "description": "万元",
          "children": [
            {
              "type": "Chart",
              "kind": "donut",
              "labels": [
                "面料",
                "纱线",
                "辅料",
                "包装",
                "成品"
              ],
              "series": [
                {
                  "name": "库存金额",
                  "values": [
                    980,
                    640,
                    310,
                    90,
                    440
                  ]
                }
              ],
              "unit": "万",
              "summary": "面料占库存金额最多"
            }
          ]
        },
        {
          "type": "Card",
          "title": "近 7 天出入库",
          "description": "吨",
          "children": [
            {
              "type": "Chart",
              "kind": "bar",
              "labels": [
                "10-05",
                "10-06",
                "10-07",
                "10-08",
                "10-09",
                "10-10",
                "10-11"
              ],
              "series": [
                {
                  "name": "入库",
                  "values": [
                    42,
                    38,
                    12,
                    51,
                    47,
                    39,
                    18
                  ]
                },
                {
                  "name": "出库",
                  "values": [
                    45,
                    41,
                    20,
                    49,
                    53,
                    44,
                    26
                  ]
                }
              ],
              "unit": "吨",
              "summary": "近 7 天出库比入库多"
            }
          ]
        }
      ]
    }
  ]
}
