name: reject
amis_schema: |-
  {
      "type": "service",
      "body": [
          {
              "type": "button",
              "label": "拒绝",
              "id": "u:reject",
              "visibleOn": "${global.userId === distributer && need_approve == true && status == 'pending'}",
              "actionType": "ajax",
              "confirmText": "确定要拒绝收集表中的数据吗?",
              "confirmTitle": "拒绝收集表数据",
              "api": {
                  "url": "${context.rootUrl}/api/v1/b6_collect/${recordId}",
                  "method": "put",
                  "requestAdaptor": "var status = \"draft\";\napi.data = {\n  doc: {\n    status: status\n  }\n}",
                  "adaptor": "",
                  "messages": {
                      "success": "已成功拒绝该收集表中数据！",
                      "failed": "很抱歉，提交过程中出现问题。请稍后重试或联系技术支持！"
                  }
              },
              "editorState": "default"
          }
      ],
      "regions": [
          "body"
      ],
      "data": {
          "context": {},
          "dataComponentId": "",
          "record_id": "",
          "record": {},
          "permissions": {}
      },
      "id": "u:627b94b32af8",
      "bodyClassName": "p-0",
      "dsType": "api",
      "asideResizor": false,
      "editorState": "default",
      "pullRefresh": {
          "disabled": true
      }
  }
description: 拒绝收集表中收集到的数据
is_enable: true
label: 拒绝
locked: false
'on': record_only
type: amis_button
visible: true
