import React, { Component } from "react";
import {
  Radio,
  Tag,
  Input,
  Button,
  Checkbox,
  Table
} from "antd";
import ReactToPrint from 'react-to-print';
import './progressDetail.less';

const { TextArea } = Input;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;

class ProgressDetail extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isPrint: false,
      columns: [
        {
          title: '检查开始时间',
          dataIndex: 'startTime',
          key: 'startTime',
          render: (text, record) => {
            return (
              <span>{text || record.startTimeStr}</span>
            )
          }
        },
        {
          title: '检查结束时间',
          dataIndex: 'endTime',
          key: 'endTime',
          render: (text, record) => {
            return (
              <span>{text || record.endTimeStr}</span>
            )
          }
        },
        {
          title: '检查部门',
          dataIndex: 'depName',
          key: 'depName',
        },
        {
          title: '被检查年度',
          dataIndex: 'yearFeature',
          key: 'yearFeature',
        },
        {
          title: '检查方式',
          dataIndex: 'inspectWay',
          key: 'inspectWay',
          render: (text, record) => {
            return (
              <span>{['线上', '线下'][text]}</span>
            )
          }
        },
        {
          title: '检查类别',
          dataIndex: 'type',
          key: 'type',
          render: (text, record) => {
            return (
              <span>{[record.typeOther, '高新技术税收优惠政策检查', '加计扣除税收优惠政策检查', '税务常规检查', '税务对研发费用检查', '税务稽查'][text]}</span>
            )
          }
        },
        {
          title: '检查事项',
          dataIndex: 'inspectionItems',
          key: 'inspectionItems',
          width: '10%',
          render: (text, record) => {
            return (
              <span>{[record.inspectionItemsOther, '高新产品收入不达标', '人员人工费用问题检查', '研发费用占比不达标', '属于多个类别', '其他事项检查'][text]}</span>
            )
          }
        },
        {
          title: '企业问题点',
          dataIndex: 'enterpriseProblems',
          key: 'enterpriseProblems',
          width: '10%',
        },
        {
          title: '解决方式',
          dataIndex: 'solution',
          key: 'solution',
          width: '10%',
        },
        {
          title: '检查后结论',
          dataIndex: 'inspectionConclusion',
          key: 'inspectionConclusion',
          width: '10%',
          render: (text, record) => {
            return (
              <span>{['其他', '被取消高新认定资格', '不通过', '合规通过', '通过', '无结论', '要求整改'][text]}</span>
            )
          }
        },
        {
          title: '是否提醒企业专人跟进事宜',
          dataIndex: 'remindFollow',
          key: 'remindFollow',
          width: 90,
          render: (text, record) => {
            return (
              <span>{['未提醒', '已提醒'][text]}</span>
            )
          }
        },
        {
          title: '备注',
          dataIndex: 'remarks',
          key: 'remarks',
          width: '10%',
        },

      ],
    }
  }


  render() {
    const { columns } = this.state
    const { data } = this.props
    const radioStyle = {
      // display: 'block',
      // height: '30px',
      // lineHeight: '30px',
    };
    const mothOptions = [
      { label: '1月', value: '1' },
      { label: '2月', value: '2' },
      { label: '3月', value: '3' },
      { label: '4月', value: '4' },
      { label: '5月', value: '5' },
      { label: '6月', value: '6' },
      { label: '7月', value: '7' },
      { label: '8月', value: '8' },
      { label: '9月', value: '9' },
      { label: '10月', value: '10' },
      { label: '11月', value: '11' },
      { label: '12月', value: '12' },
    ]
    return (
      <div className="progress" >
        <div
          className="pro-content"
          ref={ref => {
            this.printTemp = ref
          }}
        >
          <div className="pc-title">{data.userName || '_____'}</div>
          <div className="pc-row">
            <div className="pr-item">
              <div><span>合同编号：</span>{data.contractNo || '_____'}</div>
              <div>&nbsp;</div>
              <div><span>会员等级：</span>{data.memberLvl || '_____'}&nbsp;&nbsp;&nbsp;&nbsp;<Tag color="#2db7f5"><span style={{ color: "#fff" }}>会员</span></Tag></div>
            </div>
            <div className="pr-item">
              <div className="pi-tit">服务内容</div>
              {
                !!data.taskList && data.taskList.map(item =>
                  <div key={item.id}>{item.taskName}&nbsp;{item.serviceYear}</div>
                )
              }
            </div>
            <div className="pr-itemsss">
              <div className="pi-tit">服务团队</div>
              <div>
                <span>业务负责人：</span>
                <span>{data.taskName || '_____'}</span>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <span>项目负责人：</span>
                <span>{data.projectName || '_____'}</span>
              </div>
              <div>
                <span>技术咨询师：</span>
                <span>{data.technologyName || '_____'}</span>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <span>财税咨询师：</span>
                <span>{data.financeTaxationName || '_____'}</span>
              </div>
            </div>
          </div>
          <div className="pc-tit">基础数据</div>
          <div className="pc-row">
            <div className="pr-item">
              <div className="pi-tit">上年度（{data.lastYear || '_____'}年）</div>
              <div>销售收入：{data.lastRdSalesAmount || '_____'}万元</div>
              <div>高新研发费用：{data.lastRdBudget || '_____'}万元</div>
            </div>
            <div className="pr-item">
              <div className="pi-tit">上上年度（{data.beforeLastYear || '_____'}年）</div>
              <div>销售收入：{data.beforeLastRdSalesAmount || '_____'}万元</div>
              <div>高新研发费用：{data.beforeLastRdBudget || '_____'}万元</div>
            </div>
            <div className="pr-items">
              <div className="pi-tit">本年度企业人员情况</div>
              <div>职工总数：{data.workersNumber || '_____'}人
                &nbsp;&nbsp;
                科技人员：{data.technologyNumber || '_____'}人
              </div>
              <div>占比：{data.workersRate || 0}%</div>
            </div>
          </div>
          <div className="pc-tit">科研立项与研发投入</div>
          <div className="pc-row">
            <div className="pr-item">
              <div className="pi-tit">立项和预算</div>
              <div>研发立项数量：{data.projectApprovalNumber || '_____'}个</div>
              <div>年度研发预算总额：{data.rdBudget || '_____'}万元</div>
              <div>年度销售收入预计：{data.rdSalesAmount || '_____'}万元</div>
            </div>
            <div className="pr-item">
              <div className="pi-tit">&nbsp;</div>
              <div>&nbsp;</div>
              <div>本年度研发费用预算占比：{data.rdBudgetRate || 0}%</div>
              <div>三年研发费用占比预估：{data.threeYearsRdBudgetRate || 0}%</div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-items">
              <div className="pi-tit">实际情况</div>
              <div>数据周期（累计）：
                <RadioGroup
                  value={data.dataCycle}
                >
                  <Radio style={radioStyle} value={0}>第1季度</Radio>
                  <Radio style={radioStyle} value={1}>上半年</Radio>
                  <Radio style={radioStyle} value={2}>前3季度</Radio>
                  <Radio style={radioStyle} value={3}>全年</Radio>
                </RadioGroup>
              </div>
              <div>
                已立项RD数量：{data.actualRdNumber || '_____'}个，
                其中委外项目{data.actualOutsourcingNumber || '_____'}个，
                合作项目{data.actualCooperateNumber || '_____'}个，
                完成技术合同登记{data.actualRegistrationNumber || '_____'}个
              </div>
              <div>已归集研发费用总额：{data.actualRdAmount || '_____'}万元</div>
              <div>研发预算完成进度：{data.rdCompletionProgress || 0}%</div>
            </div>
            <div className="pr-items">
              <div className="pi-tit">&nbsp;</div>
              <div>年度实际销售收入：{data.actualSalesAmount || '_____'}万元</div>
              <div>本年度研发费用占比：{data.actualRdRate || 0}%</div>
              <div>三年研发费用占比：{data.threeYearsActualRdRate || 0}%</div>
            </div>
          </div>
          <div className="pc-tit">报表报送</div>
          <div className="pc-row">
            <div className="pr-items">
              <div>
                <span>火炬统计：</span>
                <RadioGroup
                  value={data.torchStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.torchStatus === 0 ? data.torchOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>统计年报：</span>
                <RadioGroup
                  value={data.statisticsStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.statisticsStatus === 0 ? data.statisticsOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
            </div>
            <div className="pr-items">
              <div>
                <span>高企年报：</span>
                <RadioGroup
                  value={data.chStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.chStatus === 0 ? data.chOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>汇算清缴：</span>
                <RadioGroup
                  value={data.finalSettlementStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.finalSettlementStatus === 0 ? data.finalSettlementOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>加扣RD{data.reportFormsRdNumber || '_____'}个，其中有知识产权的加扣费用{data.intellectualPropertyAmount || '_____'} 万元，加扣研发费用金额{data.reportRdAmount || '_____'}万元</div>
            </div>
          </div>
          <div className="pc-tit">研发奖补</div>
          <div className="pc-row">
            <div className="pr-items">
              <div>
                <span>研发准备金备案：</span>
                <RadioGroup
                  value={data.rdReservesStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.rdReservesStatus === 0 ? data.rdReservesOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
            </div>
            <div className="pr-items">
              <div>
                <span>研发奖补申请：</span>
                <RadioGroup
                  value={data.rdAwardCompensationStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.rdAwardCompensationStatus === 0 ? data.rdAwardCompensationOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>申请金额：</span>{data.rdApplicationFee || '_____'}万元，
                <span>公示金额：</span>{data.rdAnnouncementAmount || '_____'}万元，
                其他{data.rdAnnouncementOther}
              </div>
            </div>
          </div>
          <div className="pc-tit">备查交付与归档</div>
          <div className="pc-row">
            <div className="pr-items">
              <div>
                <span>加扣备查交付：</span>
                <RadioGroup
                  value={data.adDeliverStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.adDeliverStatus === 0 ? data.adDeliverOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>是否归档：</span>
                <RadioGroup
                  value={data.adDeliverFinish}
                >
                  <Radio style={radioStyle} value={0}>未归档</Radio>
                  <Radio style={radioStyle} value={1}>已归档</Radio>
                </RadioGroup>
              </div>
            </div>
            <div className="pr-items">
              <div>
                <span>高新备查交付：</span>
                <RadioGroup
                  value={data.htDeliverStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.htDeliverStatus === 0 ? data.htDeliverOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>是否归档：</span>
                <RadioGroup
                  value={data.htDeliverFinish}
                >
                  <Radio style={radioStyle} value={1}>未归档</Radio>
                  <Radio style={radioStyle} value={2}>已归档</Radio>
                </RadioGroup>
              </div>
            </div>
          </div>
          <div className="pc-tit">日常工作</div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>召开上年度总结及本年工作计划：</span>
                <RadioGroup
                  value={data.closeMeetingStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.closeMeetingStatus === 0 ? data.closeMeetingOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>阶段性汇报：</span>
                <RadioGroup
                  value={data.phasedType}
                >
                  <Radio style={radioStyle} value={1}>月度</Radio>
                  <Radio style={radioStyle} value={2}>季度</Radio>
                </RadioGroup>
              </div>
              <div style={{ margin: '5px 0 0 72px', paddingTop: '5px', borderTop: '1px dashed #000000A6' }}>
                <CheckboxGroup
                  options={mothOptions}
                  value={data.phasedContent}
                />
              </div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>立项资料编写：</span>完成数{data.projectApprovalWriteNumber || '_____'}个
                &nbsp;&nbsp;&nbsp;完成率（系统自动计算）{data.projectApprovalWriteRate || '_____'}</div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>加计预申报：</span>
                7月：
                <RadioGroup
                  value={data.adPrepareJulyStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.adPrepareJulyStatus === 0 ? data.adPrepareJulyOther || '_____' : null}
                  </Radio>
                </RadioGroup>
                &nbsp;&nbsp;
                10月：
                <RadioGroup
                  value={data.adPrepareOctoberStatus}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.adPrepareOctoberStatus === 0 ? data.adPrepareOctoberOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div><span>知识产权情况：</span></div>
              <div>
                <span>发明专利：</span>
                当年申报数量{data.ipInventionPatentDeclare || '_____'}个，
                当年授权数量{data.ipInventionPatentAuthorize || '_____'}个，
                企业累计授权数量{data.ipInventionPatentAuthorizeCount || '_____'}个。</div>
              <div>
                <span>实用新型专利：</span>
                当年申报数量{data.ipUtilityModelDeclare || '_____'} 个，
                当年授权数量{data.ipUtilityModelAuthorize || '_____'}个，
                企业累计授权数量{data.ipUtilityModelAuthorizeCount || '_____'}个。
              </div>
              <div><span>软著：</span>
                当年申请数量{data.ipSoftwareWorksDeclare || '_____'}个，
                当年下证数量{data.ipSoftwareWorksAuthorize || '_____'}个，
                企业累计下证数量{data.ipSoftwareWorksAuthorizeCount || '_____'}个。
              </div>
              <div>
                截止本年末可用于下次高新认定数量{data.ipHt || '_____'} 个，
                其中I类{data.ipHtI || '_____'}个，
                II类{data.ipHtIi || '_____'}个。
              </div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>公出指标（本年度）：</span>
                合同约定次数：{data.publicReleaseStipulation || '_____'}次&nbsp;&nbsp;&nbsp;
                实际次数：{data.publicReleaseActual || '_____'}次&nbsp;&nbsp;&nbsp;
              </div>
            </div>
          </div>
          <div className="p-line"></div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>培训指标（本年度）：</span>
                合同约定次数：{data.trainingStipulation || '_____'}次&nbsp;&nbsp;&nbsp;
                实际次数：{data.trainingActual || '_____'}次&nbsp;&nbsp;&nbsp;
                其他：{data.trainingOther || '_____'}
              </div>
            </div>
          </div>
          <div className="pc-tit">
            特色工作
          </div>
          <div className="patent-table">
            <Table
              bordered
              columns={columns}
              dataSource={data.featureList}
              pagination={false}
            />
          </div>
          <div className="pc-tit">高新认定</div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div>
                <span>1.基础情况：</span>
                创新能力评价估分{data.htScore || '_____'}分，
                实际申报批次：
                <RadioGroup
                  value={data.htBatch}
                >
                  <Radio style={radioStyle} value={1}>第1批</Radio>
                  <Radio style={radioStyle} value={2}>第2批</Radio>
                  <Radio style={radioStyle} value={3}>第3批</Radio>
                </RadioGroup>
                ，是否重点关注：
                <RadioGroup
                  value={data.htFocus}
                >
                  <Radio style={radioStyle} value={1}>是</Radio>
                  <Radio style={radioStyle} value={0}>否</Radio>
                </RadioGroup>
              </div>
              <div>
                <span>2.申报提交：</span>
                网上系统提交：
                <RadioGroup
                  value={data.webSubmit}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.webSubmit === 0 ? data.webSubmitOther || '_____' : null}
                  </Radio>
                </RadioGroup>
                纸质材料提交：
                <RadioGroup
                  value={data.paperSubmit}
                >
                  <Radio style={radioStyle} value={1}>待完成</Radio>
                  <Radio style={radioStyle} value={2}>已完成</Radio>
                  <Radio style={radioStyle} value={3}>合同无此项</Radio>
                  <Radio style={radioStyle} value={0}>
                    其他
                    {data.paperSubmit === 0 ? data.paperSubmitOther || '_____' : null}
                  </Radio>
                </RadioGroup>
              </div>
              <div>
                <span>3.评审情况：</span>
                省级：
                <RadioGroup
                  value={data.reviewProvince}
                >
                  <Radio style={radioStyle} value={0}>淘汰</Radio>
                  <Radio style={radioStyle} value={1}>公示，公示序号：{data.reviewProvinceNumber || '_____'}</Radio>
                </RadioGroup>
                国家级：
                <RadioGroup
                  value={data.reviewCountry}
                >
                  <Radio style={radioStyle} value={1}>淘汰</Radio>
                  <Radio style={radioStyle} value={2}>公示，高企编号：{data.reviewCountryNumber || '_____'}</Radio>
                </RadioGroup>
              </div>
            </div>
          </div>
          <div className="pc-tit">其他事项说明</div>
          <div className="pc-row">{data.remarks}</div>
          <div className="pc-tit">客户签字</div>
          <div className="pc-row">
            <div className="pr-itemss">
              <div style={{ paddingBottom: 80 }}><span>授权代表（签字或盖章）：</span></div>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

export default ProgressDetail;
