
import React from 'react';
import { Button } from 'antd'
import {message} from "antd/lib/index";

export default {
    btnCheckBOM: ({record, close, loadData, login, btn, dispatch}) => {
      const confirm = () => {    
      const json = {Keyword: record.ID};
          dispatch({
            type: 'stackMaterial/checkBOM',
            payload: json,
            onComplete: (ret) => {
              if (ret) {
                message.success('执行成功');
                loadData();
              }
            }
          })
        }
        return {
          content:<Button onClick={confirm}
                           type={btn.CSS} icon={btn.ICON} title={btn.LABEL} size="small"/>,
        };
      },
}