forked from huge/frontEnd/hugeOA

liuwh
2020-04-06 f2beb1a99946d07a6c7d17efbd0fb162bebeaf87
src/components/page/DocumentEditPage/index.jsx
@@ -37,7 +37,8 @@
  }
  loadData = () => {
    const { id } = this.props;
    const { id } = this.props.match.params;
    console.log(this.props)
    console.log(id)
    let _this = this;
    _this.setState({
@@ -75,11 +76,11 @@
    const { savedate } = this.state;
    console.log(savedate)
    if (savedate.documentType == 'DT00001') {
      if (!savedate.documentItle) {
      if (!savedate.documentTitle) {
        return message.warning('规章制度标题不能为空')
      }
    } else {
      if (!savedate.documentItle) {
      if (!savedate.documentTitle) {
        return message.warning('通知标题不能为空')
      } else if (!savedate.documentContent) {
        return message.warning('通知内容不能为空')
@@ -98,6 +99,8 @@
      _this.setState({
        iconLoading: false,
      });
      message.success("提交成功!");
      this.props.history.goBack()
    });
    // Fetch.savePatrolCom(savedate)
    //   .then(res => {
@@ -111,7 +114,14 @@
  }
  cancle = () => {
    this.props.history.push("/index/workbench");
    // this.props.history.push("/index/workbench");
    const { id } = this.props.match.params;
    if (id) {
      this.props.history.goBack()
    } else {
      this.props.history.push("/index/workbench");
    }
    // console.log(this.props)
  }
  render() {
@@ -189,7 +199,7 @@
            }
            <Row gutter={16}>
              <Col className="gutter-row" style={{ margin: '12px 0' }} >
                <Input disabled={disabled} style={{ width: '300px' }} name='documentItle' onChange={this.saveInputChange} value={savedate.documentItle || ""} />
                <Input disabled={disabled} style={{ width: '300px' }} name='documentTitle' onChange={this.saveInputChange} value={savedate.documentTitle || ""} />
              </Col>
            </Row>
@@ -220,8 +230,8 @@
            {savedate.documentType == 'DT00001' &&
              <Row gutter={16} >
                <Col className="gutter-row" >
                  <Upload disabled={disabled} {...props}>
                    <Button>
                  <Upload {...props}>
                    <Button disabled={disabled}>
                      <Icon type="upload" />上传文件</Button>
                  </Upload>
                </Col>