
import {extendRule, initQueryFilter} from "../../utils/common";
import { ConfirmButton } from '@woowalker/feui'
import {message} from "antd/lib/index";

//MRP单编辑
export default {
  btnResetVal:({record,loadData,login,dispatch,btn,getSelectedRowKeys,clearSelectedRowKeys, getSelectedRecords, getLoadParam, btnCustomParams})=> {
    let confirmTitle = '是否确认重置当前值?';
    
    const confirm=()=>{
      let val = initQueryFilter(login.OrgId, 1, 100, "NUM", 0);
      val["Keyword"]=record.ID;
      //debugger;
      dispatch({
        type: 'app/getDataByPost',
        payload: val,
        url:'BD/BDReductionFactor/ResetValue',
        onComplete: (ret) => {
          if(ret) {
            message.success('执行成功');
            loadData();
          }
        }
      })
    };
    return {
      content:<ConfirmButton isConfirm={true} confirmTitle={confirmTitle} onClick={confirm}
                     type="primary" icon="minus" title="重置当前值" size="small" />,
    };
  }
}
