123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905 |
- import React from 'react';
- import { Icon, Tooltip, Modal, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
- import moment from 'moment';
- import './techAchievement.less';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import { IndustryObject } from '../../DicIndustryList.js';
- import { beforeUploadFile, splitUrl, companySearch } from '../../tools.js';
- const KeyWordTagGroup = React.createClass({
- getInitialState() {
- return {
- tags: [],
- inputVisible: false,
- inputValue: ''
- };
- },
- handleClose(removedTag) {
- const tags = this.state.tags.filter(tag => tag !== removedTag);
- this.props.tagsArr(tags);
- this.setState({ tags });
- },
- showInput() {
- this.setState({ inputVisible: true }, () => this.input.focus());
- },
- handleInputChange(e) {
- this.setState({ inputValue: e.target.value });
- },
- handleInputConfirm() {
- const state = this.state;
- const inputValue = state.inputValue;
- let tags = state.tags;
- if (inputValue && tags.indexOf(inputValue) === -1) {
- tags = [...tags, inputValue];
- }
- this.props.tagsArr(tags);
- this.setState({
- tags,
- inputVisible: false,
- inputValue: '',
- });
- },
- componentWillMount() {
- this.state.tags = this.props.keyWordArr;
- },
- componentWillReceiveProps(nextProps) {
- if (this.props.keyWordArr != nextProps.keyWordArr) {
- this.state.tags = nextProps.keyWordArr;
- };
- },
- render() {
- const { tags, inputVisible, inputValue } = this.state;
- return (
- <div className="keyWord-tips">
- {tags.map((tag, index) => {
- const isLongTag = tag.length > 10;
- const tagElem = (
- <Tag key={tag} closable={index !== -1} afterClose={() => this.handleClose(tag)}>
- {isLongTag ? `${tag.slice(0, 10)}...` : tag}
- </Tag>
- );
- return isLongTag ? <Tooltip title={tag}>{tagElem}</Tooltip> : tagElem;
- })}
- {inputVisible && (
- <Input
- ref={input => this.input = input}
- type="text"
- style={{ width: 78 }}
- value={inputValue}
- onChange={this.handleInputChange}
- onBlur={this.handleInputConfirm}
- onPressEnter={this.handleInputConfirm}
- />
- )}
- {!inputVisible && <Button className="addtips" type="dashed" disabled={tags.length > 9 ? true : false} onClick={this.showInput}>+ 新关键词</Button>}
- </div>
- );
- }
- });
- const PicturesWall = React.createClass({
- getInitialState() {
- return {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- }
- },
- handleCancel() {
- this.setState({ previewVisible: false })
- },
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- },
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({ fileList });
- this.props.fileList(fileList);
- },
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- },
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
- <div>
- <Icon type="plus" />
- <div className="ant-upload-text">点击上传</div>
- </div>
- );
- return (
- <div className="clearfix">
- <Upload
- action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
- data={{ 'sign': this.props.pictureSign }}
- listType="picture-card"
- fileList={fileList}
- onPreview={this.handlePreview}
- onChange={this.handleChange} >
- {fileList.length >= 5 ? null : uploadButton}
- </Upload>
- <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
- <img alt="example" style={{ width: '100%' }} src={previewImage} />
- </Modal>
- </div>
- );
- }
- });
- const AchievementDetailForm = Form.create()(React.createClass({
- getInitialState() {
- return {
- visible: false,
- loading: false,
- textFileList: [],
- techPlanFileList: [],
- businessPlanFileList: [],
- maturityPictureUrl: [],
- technicalPictureUrl: [],
- tags: []
- };
- },
- loadData(id) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/detail",
- data: {
- id: id
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- let d = new Date()
- if (thisData && thisData.dateOfBirthMonth && thisData.dateOfBirthYear) {
- d.setMonth(thisData.dateOfBirthMonth - 1);
- d.setYear(parseInt(thisData.dateOfBirthYear));
- };
- this.setState({
- data: thisData,
- orgDisplay: thisData.ownerType,
- tags: thisData.keyword ? thisData.keyword.split(",") : [],
- technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getSalesmanList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/salesman",
- success: function (data) {
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- return;
- };
- let _me = this, theArr = [];
- for (var item in data.data) {
- theArr.push(
- <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
- )
- };
- this.setState({
- salesmanOption: theArr
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getTagsArr(e) {
- this.setState({ tags: e });
- },
- getMaturityPictureUrl(e) {
- this.setState({ maturityPictureUrl: e });
- },
- getTechnicalPictureUrl(e) {
- this.setState({ technicalPictureUrl: e });
- },
- handleSubmit(e) {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- //keyword长度判断
- if (this.state.tags.length < 3) {
- message.warning('关键词数量不能小于3个!');
- return;
- };
- //url转化
- let theTechnicalPictureUrl = [];
- if (this.state.technicalPictureUrl.length) {
- let picArr = [];
- this.state.technicalPictureUrl.map(function (item) {
- picArr.push(item.response.data);
- });
- theTechnicalPictureUrl = picArr.join(",");
- };
- let theMaturityPictureUrl = [];
- if (this.state.maturityPictureUrl.length) {
- let picArr = [];
- this.state.maturityPictureUrl.map(function (item) {
- picArr.push(item.response.data);
- });
- theMaturityPictureUrl = picArr.join(",");
- };
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: this.props.data.id ? globalConfig.context + '/api/admin/achievement/update' : globalConfig.context + '/api/admin/achievement/apply',
- data: {
- id: this.props.data.id,
- dataCategory: values.dataCategory,
- serialNumber: this.props.data.serialNumber,
- name: values.name,
- keyword: this.state.tags ? this.state.tags.join(",") : [],
- category: values.category,
- summary: values.summary,
- introduction: values.introduction,
- technicalPictureUrl: theTechnicalPictureUrl,
- fieldA: values.field ? values.field[0] : undefined,
- fieldB: values.field ? values.field[1] : undefined,
- maturity: values.maturity,
- maturityPictureUrl: theMaturityPictureUrl,
- maturityTextFileUrl: this.state.maturityTextFileUrl,
- maturityVideoUrl: values.maturityVideoUrl,
- innovation: values.innovation,
- ownerName: values.ownerName,
- ownerType: values.ownerType,
- ownerIdNumber: values.ownerIdNumber,
- ownerMobile: values.ownerMobile,
- ownerEmail: values.ownerEmail,
- ownerPostalAddress: values.ownerPostalAddress,
- cooperationMode: values.cooperationMode,
- transferMode: values.transferMode,
- bargainingMode: values.bargainingMode,
- transferPrice: values.transferPrice,
- technicalScene: values.technicalScene,
- breakthrough: values.breakthrough,
- patentCase: values.patentCase,
- awards: values.awards,
- teamDes: values.teamDes,
- parameter: values.parameter,
- orgId: values.orgId,
- orgName: values.orgName,
- orgAddress: values.orgAddress,
- orgEmail: values.orgEmail,
- orgContacts: values.orgContacts,
- orgContactsMobile: values.orgContactsMobile,
- releaseStatus: values.releaseStatus,
- techPlanUrl: this.state.techPlanUrl,
- businessPlanUrl: this.state.businessPlanUrl
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('保存成功!');
- this.setState({
- visible: false
- });
- this.props.handleOk();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- }
- });
- },
- componentWillMount() {
- this.getSalesmanList();
- if (this.props.data.id) {
- this.loadData(this.props.data.id, this.props.detailApiUrl);
- } else {
- this.state.data = {};
- };
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- this.state.textFileList = [];
- this.state.techPlanFileList = [];
- this.state.businessPlanFileList = [];
- if (nextProps.data.id) {
- this.loadData(nextProps.data.id);
- } else {
- this.state.data = {};
- this.state.tags = [];
- this.state.maturityPictureUrl = [];
- this.state.technicalPictureUrl = [];
- };
- this.props.form.resetFields();
- };
- },
- render() {
- const theData = this.state.data || {};
- const { getFieldDecorator } = this.props.form;
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- return (
- <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="编号" >
- <span>{theData.serialNumber}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="名称" >
- {getFieldDecorator('name', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.name
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="数据类别" >
- {getFieldDecorator('dataCategory', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.dataCategory
- })(
- <Select placeholder="选择数据类型" style={{ width: 160 }} >
- <Select.Option value="0" >成果</Select.Option>
- <Select.Option value="1" >技术</Select.Option>
- <Select.Option value="2" >项目</Select.Option>
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="类型" >
- {getFieldDecorator('category', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.category
- })(
- <Select style={{ width: 160 }} placeholder="请选择成果类型">
- {this.props.achievementCategoryOption}
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="是否发布" >
- {getFieldDecorator('releaseStatus', {
- initialValue: theData.releaseStatus
- })(
- <Radio.Group>
- <Radio value="0">未发布</Radio>
- <Radio value="1">发布</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="发布时间" >
- <span>{theData.releaseDateFormattedDate}</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="关键词" >
- <KeyWordTagGroup
- keyWordArr={this.state.tags}
- tagsArr={this.getTagsArr}
- visible={this.props.visible} />
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="摘要" >
- {getFieldDecorator('summary', {
- initialValue: theData.summary
- })(
- <Input type="textarea" rows={4} />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成果简介" >
- {getFieldDecorator('introduction', {
- initialValue: theData.introduction
- })(
- <Input type="textarea" rows={4} placeholder="项目成果简介;项目核心创新点;项目详细用途;预期效益说明;主要技术(性能)指标;市场前景;应用范围;发展历程。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术图片" >
- <PicturesWall
- pictureSign="achievement_technical_picture"
- fileList={this.getTechnicalPictureUrl}
- pictureUrl={this.state.technicalPictureUrl} />
- <p>图片建议:专利证书或专利申请书图片、技术图纸、样品图片、技术相关网络图片;成熟度处于非研发阶段的项目,必须上传样品图片,如未上传,成熟度将视为处在研发阶段。</p>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="应用领域" >
- {getFieldDecorator('field', {
- rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
- initialValue: [theData.fieldA, theData.fieldB]
- })(
- <Cascader style={{ width: 300 }} options={IndustryObject} placeholder="应用领域" />
- )}
- </FormItem>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="成熟度" >
- {getFieldDecorator('maturity', {
- initialValue: theData.maturity
- })(
- <Select placeholder="选择成熟度" style={{ width: 160 }} >
- <Select.Option value="0" >正在研发</Select.Option>
- <Select.Option value="1" >已有样品</Select.Option>
- <Select.Option value="2" >通过小试</Select.Option>
- <Select.Option value="3" >通过中试</Select.Option>
- <Select.Option value="4" >可以量产</Select.Option>
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="创新度" >
- {getFieldDecorator('innovation', {
- initialValue: theData.innovation
- })(
- <Select placeholder="选择创新度" style={{ width: 160 }} >
- <Select.Option value="0" >行业先进</Select.Option>
- <Select.Option value="1" >行业领先</Select.Option>
- <Select.Option value="2" >国内先进</Select.Option>
- <Select.Option value="3" >国内领先</Select.Option>
- <Select.Option value="4" >国际先进</Select.Option>
- <Select.Option value="5" >国际领先</Select.Option>
- </Select>
- )}
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成熟度证明材料(图片)" >
- <PicturesWall
- pictureSign="achievement_maturity_picture"
- fileList={this.getMaturityPictureUrl}
- pictureUrl={this.state.maturityPictureUrl} />
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 6 }}
- label="成熟度证明材料(文本)" >
- <Upload
- name="ratepay"
- action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
- data={{ 'sign': 'achievement_maturity_text_file' }}
- beforeUpload={beforeUploadFile}
- fileList={this.state.textFileList}
- onChange={(info) => {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- if (!info.file.response.error.length) {
- message.success(`${info.file.name} 文件上传成功!`);
- } else {
- message.warning(info.file.response.error[0].message);
- return;
- };
- this.state.maturityTextFileUrl = info.file.response.data;
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 文件上传失败。`);
- };
- this.setState({ textFileList: info.fileList.slice(-1) });
- }} >
- <Button><Icon type="upload" /> 上传需求文本文件 </Button>
- </Upload>
- <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
- <span className="download-file">
- <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id) }}>成熟度证明材料(文本文件)</a>
- </span>
- : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成熟度证明材料(视频地址)" >
- {getFieldDecorator('maturityVideoUrl', {
- initialValue: theData.maturityVideoUrl
- })(
- <Input />
- )}
- </FormItem>
- <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="成果所有人名称" >
- {getFieldDecorator('ownerName', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所有人证件号" >
- {getFieldDecorator('ownerIdNumber', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerIdNumber
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所有人联系电话" >
- {getFieldDecorator('ownerMobile', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerMobile
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所有人电子邮箱" >
- {getFieldDecorator('ownerEmail', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerEmail
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所有人通信地址" >
- {getFieldDecorator('ownerPostalAddress', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerPostalAddress
- })(
- <Input />
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="所有人类型" >
- {getFieldDecorator('ownerType', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.ownerType
- })(
- <Radio.Group onChange={(e) => { this.setState({ orgDisplay: e.target.value }); }}>
- <Radio value="0">个人</Radio>
- <Radio value="1">组织</Radio>
- </Radio.Group>
- )}
- </FormItem>
- </div>
- <div className="clearfix" style={{ display: this.state.orgDisplay == '1' ? 'block' : 'none' }}>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属组织名称" >
- {getFieldDecorator('orgName', {
- initialValue: theData.orgName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属组织地址" >
- {getFieldDecorator('orgAddress', {
- initialValue: theData.orgAddress
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属组织邮箱" >
- {getFieldDecorator('orgEmail', {
- initialValue: theData.orgEmail
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属组织联系人名称" >
- {getFieldDecorator('orgContacts', {
- initialValue: theData.orgContacts
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属组织联系人电话" >
- {getFieldDecorator('orgContactsMobile', {
- initialValue: theData.orgContactsMobile
- })(
- <Input />
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="合作方式" >
- {getFieldDecorator('cooperationMode', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.cooperationMode
- })(
- <Radio.Group>
- <Radio value="0">技术转让</Radio>
- <Radio value="1">授权生产</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="转让方式" >
- {getFieldDecorator('transferMode', {
- initialValue: theData.transferMode
- })(
- <Select placeholder="选择转让方式" style={{ width: 160 }} >
- <Select.Option value="0" >完全转让</Select.Option>
- <Select.Option value="1" >许可转让</Select.Option>
- <Select.Option value="2" >技术入股</Select.Option>
- </Select>
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="议价方式" >
- {getFieldDecorator('bargainingMode', {
- initialValue: theData.bargainingMode
- })(
- <Radio.Group>
- <Radio value="0">面议</Radio>
- <Radio value="1">定价</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="转让价格" >
- {getFieldDecorator('transferPrice', {
- initialValue: theData.transferPrice
- })(
- <InputNumber />
- )}
- <span style={{ marginLeft: '20px' }}>万元</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术场景" >
- {getFieldDecorator('technicalScene', {
- initialValue: theData.technicalScene
- })(
- <Input type="textarea" rows={2} placeholder="说明解决了什么问题。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术突破" >
- {getFieldDecorator('breakthrough', {
- initialValue: theData.breakthrough
- })(
- <Input type="textarea" rows={2} placeholder="说明该技术成果突破性的研究。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="专利情况" >
- {getFieldDecorator('patentCase', {
- initialValue: theData.patentCase
- })(
- <Input type="textarea" rows={2} placeholder="一个“技术”可能由多个专利构成,需要说明技术-专利的关系。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="获奖情况" >
- {getFieldDecorator('awards', {
- initialValue: theData.awards
- })(
- <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术团队情况" >
- {getFieldDecorator('teamDes', {
- initialValue: theData.teamDes
- })(
- <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术参数" >
- {getFieldDecorator('parameter', {
- initialValue: theData.parameter
- })(
- <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 6 }}
- label="技术方案" >
- <Upload
- name="ratepay"
- action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
- data={{ 'sign': 'achievement_tech_plan' }}
- beforeUpload={beforeUploadFile}
- fileList={this.state.techPlanFileList}
- onChange={(info) => {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- if (!info.file.response.error.length) {
- message.success(`${info.file.name} 文件上传成功!`);
- } else {
- message.warning(info.file.response.error[0].message);
- return;
- };
- this.state.techPlanUrl = info.file.response.data;
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 文件上传失败。`);
- };
- this.setState({ techPlanFileList: info.fileList.slice(-1) });
- }} >
- <Button><Icon type="upload" /> 上传技术方案文件 </Button>
- </Upload>
- <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
- <span className="download-file">
- <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
- </span>
- : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 6 }}
- label="商业计划书" >
- <Upload
- name="ratepay"
- action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
- data={{ 'sign': 'achievement_business_plan' }}
- beforeUpload={beforeUploadFile}
- fileList={this.state.businessPlanFileList}
- onChange={(info) => {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- if (!info.file.response.error.length) {
- message.success(`${info.file.name} 文件上传成功!`);
- } else {
- message.warning(info.file.response.error[0].message);
- return;
- };
- this.state.businessPlanUrl = info.file.response.data;
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 文件上传失败。`);
- };
- this.setState({ businessPlanFileList: info.fileList.slice(-1) });
- }} >
- <Button><Icon type="upload" /> 上传商业计划书文件 </Button>
- </Upload>
- <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
- <span className="download-file">
- <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
- </span>
- : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
- </FormItem>
- <FormItem wrapperCol={{ span: 12, offset: 3 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
- </FormItem>
- </Form >
- )
- }
- }));
- const AchievementDetail = React.createClass({
- getInitialState() {
- return {
- visible: false
- };
- },
- showModal() {
- this.setState({
- visible: true,
- });
- },
- handleCancel(e) {
- this.setState({
- visible: false,
- });
- this.props.closeDesc(false);
- },
- handleOk(e) {
- this.setState({
- visible: false,
- });
- this.props.closeDesc(false, true);
- },
- componentWillReceiveProps(nextProps) {
- this.state.visible = nextProps.showDesc;
- },
- render() {
- if (this.props.data) {
- return (
- <div className="patent-desc">
- <Modal maskClosable={false} title="成果详情" visible={this.state.visible}
- onOk={this.checkPatentProcess} onCancel={this.handleCancel}
- width='1000px'
- footer=''
- className="admin-desc-content">
- <AchievementDetailForm
- data={this.props.data}
- companyOption={this.props.companyOption}
- userOption={this.props.userOption}
- achievementCategoryOption={this.props.achievementCategoryOption}
- closeDesc={this.handleCancel}
- visible={this.state.visible}
- handleOk={this.handleOk} />
- </Modal>
- </div>
- );
- } else {
- return <div></div>
- }
- },
- });
- export default AchievementDetail;
|