import { message, Checkbox, Radio } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, guid, getDataFieldValue, setDataFieldValue, initFilter, empty, onBeforeSaveHandleRecordLog, Format } from "../../utils/common";
import { connect } from 'dva';
import moment from 'moment';
import SC030 from "./SC030";
/**
 * @return {string}
 */
// 编辑  应急响应评估
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.STATUS = params.customParams;
    onBeforeSaveHandleRecordLog(params, 'CM030', '应急装备需求调查')
  },

  onBeforeEdit: ({ isNew, tableKey, setFieldValueByBatch, setFieldEditable, login, stateData, dispatch }) => {
    var isTask = (tableKey != undefined && tableKey == '1') ? true : false
    var isTaskEnd = (tableKey != undefined && tableKey == '2') ? true : false
    if (isTask) {
      //待办 只能修改数量
      setFieldEditable("CODE", false);
      setFieldEditable("NAME", false);
      setFieldEditable("Nav_MaterialType.NAME", false);
      setFieldEditable("INTERNAL_NO", false);
      setFieldEditable("SPECIFICATION", false);
      setFieldEditable("UNIT", false);
      setFieldEditable("LOCATION", false);
      setFieldEditable("PURPOSE", false);
      setFieldEditable("Nav_Department.NAME", false);
      setFieldEditable("Nav_User.NAME", false);
      setFieldEditable("MAIN_TEC_PARAMS", false);
      setFieldEditable("Nav_Files", false);
    } else if (isTaskEnd) {
      //待办完成 全部不可编辑
      setFieldEditable("CODE", false);
      setFieldEditable("NAME", false);
      setFieldEditable("Nav_MaterialType.NAME", false);
      setFieldEditable("INTERNAL_NO", false);
      setFieldEditable("SPECIFICATION", false);
      setFieldEditable("UNIT", false);
      setFieldEditable("LOCATION", false);
      setFieldEditable("PURPOSE", false);
      setFieldEditable("Nav_Department.NAME", false);
      setFieldEditable("Nav_User.NAME", false);
      setFieldEditable("MAIN_TEC_PARAMS", false);
      setFieldEditable("Nav_Files", false);
      setFieldEditable("COUNT", false);
    }
  },
}
