import { message, Checkbox, Radio } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty, onBeforeSaveHandleRecordLog, Format } from "../../utils/common";
import { connect } from 'dva';
import moment from 'moment';
/**
 * @return {string}
 */
// 编辑  职业危害因素监测规则
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.STATUS = params.customParams;
    onBeforeSaveHandleRecordLog(params, 'OH034', '第三方检测报告')

  },
  onBeforeEdit: ({ isNew, stateData, setFieldVisible, setFieldValueByBatch, setFieldEditable, login }) => {
    if (isNew || !stateData.YEAR) {
      const temps = [];
      temps.push({ field: 'NAME', value: '职业危害检测报告' })
      temps.push({ field: 'YEAR', value: (new Date()).Format("yyyy") })
      setFieldValueByBatch(temps);
    }
  }
}
