import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
/**
 * @return {string}
 */
// 编辑
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.PUBLISH = params.customParams;
  },
  onBeforeEdit({ stateData, data, dispatch, setFieldVisible }) {
    if (stateData.STATUS == 9) {
      dispatch({
        type: 'app/getDataByPost',
        url: 'HM/HMHazardRecord/GetRejectContent',
        payload: {
          ID: data.id,
        },
        onComplete: (ret) => {
          if (ret) {
            stateData.AUDIT_OPINION = ret;
          }
        }
      });
    } else {
      setFieldVisible('AUDIT_OPINION', false);
    }
  }
}
