{
  "label": "指派商务负责人",
  "version": "1.0.0",
  "description": "指派商务负责人",
  "apis": {
    "/confirm": {
      "label": "确认",
      "process": "xiang.assign.confirm"
    },
    "/save": {
      "label": "保存",
      "process": "xiang.assign.save"
    },
    "/terminal": {
      "label": "关闭",
      "process": "xiang.assign.terminal"
    },
    "/submit": {
      "label": "提交审批",
      "process": "flows.assign.submit"
    },
    "/reject/reset": {
      "label": "审批驳回并重填",
      "process": "flows.assign.reject.rest"
    },
    "/reject/terminal": {
      "label": "审批驳回并关闭",
      "process": "flows.assign.reject.terminal"
    },
    "/resolve": {
      "label": "审批同意",
      "process": "flows.assign.resolve"
    }
  },
  "actions": {
    "关闭": { "@": "assign.关闭" },
    "保存": { "@": "assign.保存" },
    "提交": { "@": "assign.提交" },
    "同意": { "@": "assign.同意" },
    "驳回并重填": { "@": "assign.驳回并重填" },
    "驳回并关闭": { "@": "assign.驳回并关闭" }
  },
  "nodes": [
    {
      "name": "选择商务负责人",
      "body": {
        "type": "form",
        "props": { "name": "assign" }
      },
      "actions": ["关闭", "保存", "提交"],
      "user": { "process": "flows.current.user", "args": ["id"] }
    },
    {
      "name": "项目负责人审批",
      "body": {
        "type": "iframe",
        "props": { "src": "/workflows/assign/approve.html" }
      },
      "actions": ["驳回并重填", "驳回并关闭", "同意"],
      "user": { "process": "flows.select.manager", "args": [2] },
      "next": [
        {
          "when": [{ "审批通过": "{{$data.审批结果}}", "=": "通过" }],
          "goto": "审批通过"
        },
        {
          "when": [{ "审批通过": "{{$data.审批结果}}", "=": "驳回" }],
          "goto": "审批驳回"
        }
      ]
    },
    {
      "name": "审批通过",
      "body": {
        "type": "markdown",
        "props": {
          "content": "审批通过, {{$data.项目名称}}商务负责人为: **{{$data.商务负责人名称}}**"
        }
      },
      "actions": ["关闭"],
      "user": { "process": "flows.current.user", "args": ["id"] }
    },
    {
      "name": "审批驳回",
      "body": {
        "type": "markdown",
        "props": {
          "content": "您的请求被驳回, 驳回原因: **{{$data.驳回原因}}**"
        }
      },
      "actions": ["关闭"],
      "user": { "process": "flows.current.user", "args": ["id"] }
    }
  ]
}
