123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839 |
- import React from 'react';
- import { Tabs, Table, Icon, Tooltip, Modal, message, AutoComplete, Spin, Upload, Input, InputNumber, Select, Button, Radio, Form, Cascader, Tag, Switch } from 'antd';
- import './techAchievement.less';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import { maturityList, innovationList, transferModeList } from '../../dataDic';
- import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
- import { beforeUploadFile, splitUrl, companySearch, getTransferMode, getAchievementCategory, getTechAuditStatus, getDemandType, getMaturity, getInnovation,beforeUpload, getBase64,getboutique } from '../../tools.js';
- import throttle from '../../throttle.js';
- import ImgList from "../../common/imgList";
- 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 && inputValue.replace(/(^\s*)|(\s*$)/g, "").length != 0) {
- tags = [...tags, inputValue.replace(/(^\s*)|(\s*$)/g, "")];
- };
- 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 key={tag} 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">
- <ImgList
- domId={this.props.domId}
- uploadConfig={{
- action:globalConfig.context + "/api/admin/achievement/uploadPicture",
- data:{ 'sign': this.props.pictureSign },
- multiple:true,
- listType:"picture-card",
- }}
- onChange={(infor)=>{
- this.handleChange(infor)
- }}
- fileList={fileList}
- />
- </div>
- );
- }
- });
- const AchievementDetailShow = Form.create()(React.createClass({
- getInitialState() {
- return {
- loading: false,
- buttonLoading: false,
- contactsObj: {},
- data: {},
- tags: [],
- technicalPictureUrl: [],
- coverImg: [],
- maturityPictureUrl: [],
- textFileList: [],
- techPlanFileList: [],
- businessPlanFileList: []
- };
- },
- loadData(id, detailApiUrl) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + detailApiUrl,
- data: {
- id: id,
- ownerType:this.props.data.ownerType
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- data: thisData,
- orgDisplay: thisData.ownerType,
- switchValue: Boolean(!thisData.ownerId),
- radios:thisData.hot==='1'?true:false,
- tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
- technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
- maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- });
- if (thisData.ownerId) {
- this.getContactsList(thisData.ownerId);
- };
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- offShelf() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/offShelf",
- data: { "id": this.props.data.id }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('撤销成功!');
- this.setState({
- visible: false,
- releaseSubmitVisible: false
- });
- this.props.handleOk();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- },
- modifyBroker() {
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/audit/modifyAchievementTechBroker',
- data: {
- id: this.props.data.id,
- techBrokerId: values.modifyTechBrokerId
- }
- }).done(function (data) {
- this.state.auditStatus = 0;
- this.setState({
- loading: false
- });
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- } else {
- message.success('保存成功!');
- this.props.handleOk();
- this.componentWillMount();
- };
- }.bind(this));
- }
- });
- },
- formSubmit() {
- this.props.form.validateFields((err, values) => {
- if (values.auditStatus == 3 && !values.techBrokerId) {
- message.warning('必须选择一个技术经纪人!');
- return
- };
- if (!err) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/audit/achievement',
- data: {
- id: this.props.data.id,
- techBroderId: values.techBrokerId,
- auditStatus: values.auditStatus
- }
- }).done(function (data) {
- this.state.auditStatus = 0;
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setState({
- formSubmitVisible: false
- });
- this.props.handleOk();
- } else {
- message.warning(data.error[0].message);
- };
- }.bind(this));
- }
- });
- },
- handleSubmit(e) {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (values.auditStatus == 4) {
- this.setState({
- formSubmitVisible: true
- });
- } else {
- this.formSubmit();
- };
- });
- },
- buildMatchList() {
- this.setState({
- buttonLoading: true
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/achievement/matchDemand',
- data: {
- id: this.props.data.id,
- }
- }).done(function (data) {
- this.setState({
- buttonLoading: false
- });
- if (!data.error.length) {
- message.success('匹配完成!匹配到' + data.data + '条记录');
- } else {
- message.warning(data.error[0].message);
- };
- }.bind(this));
- },
- getContactsList(theUid) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/getContacts",
- data: {
- uid: theUid
- },
- success: function (data) {
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- return;
- };
- } else {
- this.setState({
- contactsObj: data.data || {}
- });
- };
- }.bind(this),
- });
- },
- componentWillMount() {
- this.loadData(this.props.data.id, this.props.detailApiUrl);
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- this.state.textFileList = [];
- this.state.techPlanFileList = [];
- this.state.businessPlanFileList = [];
- 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">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="编号" >
- <span>{theData.serialNumber}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="名称" >
- <span>{theData.name}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="数据类别" >
- {(() => {
- switch (theData.dataCategory) {
- case "0":
- return <span>成果</span>;
- case "1":
- return <span>技术</span>;
- case "2":
- return <span>项目</span>;
- }
- })()}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="类型" >
- <span>{getAchievementCategory(theData.category)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="精品成果" >
- {(() => {
- switch (theData.boutique) {
- case "0":
- return <span>否</span>;
- case "1":
- return <span>是</span>;
- }
- })()}
- </FormItem>
- </div>
- {this.state.radios==true ?<FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="首页展示图片:" >
- <div className="clearfix">
- <Upload className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.coverImg}
- onPreview={(file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }} >
- </Upload>
- <Modal maskClosable={false} footer={null}
- visible={this.state.previewVisible}
- onCancel={() => { this.setState({ previewVisible: false }) }}>
- <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
- </Modal>
- </div>
- </FormItem>:<div></div>}
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="发布时间" >
- <span>{theData.releaseDateFormattedDate}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="审核状态" >
- <span>{getTechAuditStatus(theData.auditStatus)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="是否国际" >
- <span>{getboutique(theData.internationalFlag)}</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="关键词" >
- {this.state.tags.map((tag) => {
- return <Tooltip key={tag} title={tag}>
- <Tag key={tag}>{tag}</Tag>
- </Tooltip>;
- })}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="摘要" >
- <span>{theData.summary}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成果简介" >
- <span>{theData.introduction}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="备注" >
- <span>{theData.remark}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术图片" >
- <div className="clearfix">
- <Upload className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.technicalPictureUrl}
- onPreview={(file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }} >
- </Upload>
- <Modal maskClosable={false} footer={null}
- visible={this.state.previewVisible}
- onCancel={() => { this.setState({ previewVisible: false }) }}>
- <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
- </Modal>
- </div>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="应用领域" >
- <span>{getIndustryCategory(theData.fieldA, theData.fieldB)}</span>
- </FormItem>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="成熟度" >
- <span>{getMaturity(theData.maturity)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="创新度" >
- <span>{getInnovation(theData.innovation)}</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成熟度证明材料(图片)" >
- <Upload className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.maturityPictureUrl}
- onPreview={(file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }} >
- </Upload>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 6 }}
- label="成熟度证明材料(文本)" >
- <p>{theData.maturityTextFileUrl ?
- <span className="download-file">
- <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
- </span>
- : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成熟度证明材料(视频地址)" >
- <span>{theData.maturityVideoUrl}</span>
- </FormItem>
- {this.state.switchValue ?
- <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="成果所有人名称" >
- <span>{theData.ownerName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系电话" >
- <span>{theData.ownerMobile}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="证件号" >
- <span>{theData.ownerIdNumber}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="电子邮箱" >
- <span>{theData.ownerEmail}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="通讯地址" >
- <span>{theData.ownerPostalAddress}</span>
- </FormItem>
- </div> : <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="成果所有人名称" >
- <span>{theData.iOwnerName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系电话" >
- {theData.ownerType == "1" ? <span>{this.state.contactsObj[theData.contacts]}</span> : <span>{theData.iOwnerMobile}</span>}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="证件号" >
- <span>{theData.iOwnerIdNumber}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="电子邮箱" >
- <span>{theData.iOwnerEmail}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="通讯地址" >
- <span>{theData.iOwnerPostalAddress}</span>
- </FormItem>
- </div>}
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="合作方式" >
- {(() => {
- switch (theData.cooperationMode) {
- case "0":
- return <span>技术转让</span>;
- case "1":
- return <span>授权生产</span>;
- }
- })()}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="转让方式" >
- <span>{getTransferMode(theData.transferMode)}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="议价方式" >
- {(() => {
- switch (theData.bargainingMode) {
- case "0":
- return <span>面议</span>;
- case "1":
- return <span>定价</span>;
- }
- })()}
- </FormItem>
- {theData.bargainingMode == 0 ? <div></div> : <FormItem className="half-item"
- {...formItemLayout}
- label="转让价格" >
- <span>{theData.transferPrice} 万元</span>
- </FormItem>}
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术场景" >
- <span>{theData.technicalScene}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术突破" >
- <span>{theData.breakthrough}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="专利情况" >
- <span>{theData.patentCase}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="获奖情况" >
- <span>{theData.awards}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术团队情况" >
- <span>{theData.teamDes}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术参数" >
- <span>{theData.parameter}</span>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 6 }}
- label="技术方案" >
- <p>{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="商业计划书" >
- <p>{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>
- {window.showAuditStatus && theData.auditStatus == 2 ? <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="审核状态" >
- {getFieldDecorator('auditStatus')(
- <Radio.Group>
- <Radio value={3}>审核通过</Radio>
- <Radio value={4}>审核未通过</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="技术经纪人" >
- {getFieldDecorator('techBrokerId', {
- initialValue: theData.techBrokerId
- })(
- <Select style={{ width: 260 }}
- placeholder="请选择技术经纪人"
- notFoundContent="未获取到经纪人列表"
- showSearch
- filterOption={companySearch}>
- {this.props.techBrodersOption}
- </Select>
- )}
- </FormItem>
- </div> : <div></div>}
- {window.showAuditStatus && theData.auditStatus == 3 ? <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="指派新经纪人" >
- {getFieldDecorator('modifyTechBrokerId', {
- initialValue: theData.techBrokerId
- })(
- <Select style={{ width: 260 }}
- placeholder="请选择要指派的新经纪人"
- notFoundContent="未获取到经纪人列表"
- showSearch
- filterOption={companySearch}>
- {this.props.techBrodersOption}
- </Select>
- )}
- </FormItem>
- </div> : <div></div>}
- <Modal maskClosable={false} title="确认"
- visible={this.state.formSubmitVisible}
- width='360px'
- footer={null}
- onCancel={() => { this.setState({ formSubmitVisible: false }) }} >
- <span>确认该需求审核未通过?</span>
- <Button className="modal-submit" type="primary" loading={this.state.loading} onClick={this.formSubmit}>确认</Button>
- <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ formSubmitVisible: false }) }}>取消</Button>
- </Modal>
- </Spin>
- </Form >
- )
- }
- }));
- const AchievementDetailForm = Form.create()(React.createClass({
- getInitialState() {
- return {
- loading: false,
- auditStatus: 0,
- textFileList: [],
- switchValue: false,
- radios: false,
- techPlanFileList: [],
- data: {},
- tags: [],
- technicalPictureUrl: [],
- coverImg: [],
- maturityPictureUrl: [],
- businessPlanFileList: [],
- dataSource: [],
- };
- },
- loadData(id, detailApiUrl) {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + detailApiUrl,
- data: {
- id: id,
- ownerType:this.props.data.ownerType
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- data: thisData,
- orgDisplay: thisData.ownerType,
- switchValue: Boolean(!thisData.ownerId),
- radios: thisData.hot == '1' ? true : false,
- transferPriceDis: thisData.bargainingMode == 1 ? true : false,
- tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
- technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
- maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
- });
- if (thisData.ownerType == "1" && thisData.ownerId) {
- this.getContactsList(thisData.ownerId);
- };
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getContactsList(theUid) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/getContacts",
- data: {
- uid: theUid
- },
- success: function (data) {
- let theOption = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- return;
- };
- };
- for (let item in data.data) {
- let theData = data.data[item];
- theOption.push(
- <Select.Option value={item} key={theData}>{theData}</Select.Option>
- );
- };
- this.setState({
- contactsOption: theOption
- });
- }.bind(this),
- });
- },
- getTagsArr(e) {
- this.setState({ tags: e });
- },
- getMaturityPictureUrl(e) {
- this.setState({ maturityPictureUrl: e });
- },
- getTechnicalPictureUrl(e) {
- this.setState({ technicalPictureUrl: e });
- },
- getcoverImg(e) {
- this.setState({coverImg: e });
- },
- handleSearch(e) {
- if (this.props.detailApiUrl.indexOf('org') != -1) {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/orgOwner",
- data: { name: e },
- success: function (data) {
- let theArr = [];
- let theObj = {};
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else if (!$.isEmptyObject(data.data)) {
- data.data.map(function (item) {
- theArr.push(item.unitName);
- theObj[item.unitName] = item.uid;
- });
- };
- this.setState({
- dataSource: theArr,
- dataSourceObj: theObj
- });
- }.bind(this),
- });
- } else {
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/userOwner",
- data: { name: e },
- success: function (data) {
- let theArr = [];
- let theObj = {};
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else if (!$.isEmptyObject(data.data)) {
- for (let item in data.data) {
- theArr.push(data.data[item]);
- theObj[data.data[item]] = item;
- };
- };
- this.setState({
- dataSource: theArr,
- dataSourceObj: theObj
- });
- }.bind(this),
- });
- };
- },
- handleSubmit(e) {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- //keyword长度判断
- if ((this.state.tags ? this.state.tags.length : this.props.tags.length) < 3) {
- message.warning('关键词数量不能小于3个!');
- return;
- };
- if (values.bargainingMode == 1 && !values.transferPrice) {
- message.warning('议价方式为[ 定价 ]时, [ 转让价格 ]不能为空!');
- return;
- }
- if(values.field[0]==undefined){
- message.warning('应用领域不能为空!')
- return false;
- }
- //url转化
- let theTechnicalPictureUrl = [];
- if (this.state.technicalPictureUrl.length) {
- let picArr = [];
- this.state.technicalPictureUrl.map(function (item) {
- if ( item.response && item.response.data && item.response.data.length ){
- picArr.push(item.response.data);
- }
- });
- theTechnicalPictureUrl = picArr.join(",");
- };
- let thecoverImg = [];
- if (this.state.coverImg.length) {
- let picArr = [];
- this.state.coverImg.map(function (item) {
- if ( item.response && item.response.data && item.response.data.length ){
- picArr.push(item.response.data);
- }
- });
- thecoverImg = picArr.join(",");
- };
- let theMaturityPictureUrl = [];
- if (this.state.maturityPictureUrl.length) {
- let picArr = [];
- this.state.maturityPictureUrl.map(function (item) {
- if ( item.response && item.response.data && item.response.data.length ){
- 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(",") : this.props.tags.join(","),
- keywords: this.state.tags ? this.state.tags : this.props.tags,
- category: values.category,
- summary: values.summary,
- introduction: values.introduction,
- remark: values.remark,
- technicalPictureUrl: theTechnicalPictureUrl,
- coverImg: thecoverImg,
- 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,
- //
- switchSign: this.state.switchValue ? 1 : 0,
- //
- ownerId: !this.state.switchValue ? (this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId) : undefined,
- contacts: !this.state.switchValue ? values.contacts : undefined,
- ownerType: this.state.orgDisplay,//this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
- //自定义
- ownerName: this.state.switchValue ? values.ownerName : undefined,
- ownerIdNumber: this.state.switchValue ? values.ownerIdNumber : undefined,
- ownerMobile: this.state.switchValue ? values.ownerMobile : undefined,
- ownerEmail: this.state.switchValue ? values.ownerEmail : undefined,
- ownerPostalAddress: this.state.switchValue ? values.ownerPostalAddress : undefined,
- //
- 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,
- releaseStatus: values.releaseStatus,
- techPlanUrl: this.state.techPlanUrl,
- businessPlanUrl: this.state.businessPlanUrl,
- auditStatus: this.state.auditStatus,
- boutique: values.boutique,
- internationalFlag:values.internationalFlag,
- hot: values.hot,
- }
- }).done(function (data) {
- this.state.auditStatus = 0;
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.props.handleOk();
- this.componentWillMount();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- }
- });
- },
- componentWillMount() {
- this.state.therottleSearch = throttle(this.handleSearch, 1000, { leading: false }).bind(this);
- if (this.props.data && this.props.data.id) {
- this.loadData(this.props.data.id, this.props.detailApiUrl);
- };
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- if (nextProps.data && nextProps.data.id) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- };
- this.state.data = {};
- this.state.tags = [];
- this.state.switchValue = false;
- this.state.radios = false;
- this.state.technicalPictureUrl = [];
- this.state.coverImg = [];
- this.state.maturityPictureUrl = [];
- this.state.textFileList = [];
- this.state.techPlanFileList = [];
- this.state.businessPlanFileList = [];
- this.props.form.resetFields();
- this.state.orgDisplay=undefined;
- };
- },
- 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">
- <Spin spinning={this.state.loading}>
- <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('boutique', {
- initialValue: theData.boutique
- })(
- <Radio.Group>
- <Radio value="0">否</Radio>
- <Radio value="1">是</Radio>
- </Radio.Group>
- )}
- </FormItem>
- {this.state.radios==true ? <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="首页展示图片:"
- style={{display:'block'}}
- >
- <PicturesWall
- domId={'techAchievementQueryDesc1'}
- pictureSign="achievement_cover_picture"
- fileList={this.getcoverImg}
- pictureUrl={this.state.coverImg} />
- <p>图片尺寸建议:220X140(像素)</p>
- </FormItem>:<div></div>}
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="是否发布" >
- {(() => {
- switch (theData.releaseStatus) {
- case "0":
- return <span>未发布</span>;
- case "1":
- return <span>已发布</span>;
- }
- })()}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="发布时间" >
- <span>{theData.releaseDateFormattedDate}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="审核状态" >
- <span>{getTechAuditStatus(theData.auditStatus)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="是否国际" >
- {getFieldDecorator('internationalFlag', {
- initialValue: theData.internationalFlag
- })(
- <Radio.Group>
- <Radio value="0">否</Radio>
- <Radio value="1">是</Radio>
- </Radio.Group>
- )}
- </FormItem>
- </div>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="关键词" >
- <KeyWordTagGroup
- keyWordArr={this.state.tags}
- tagsArr={this.getTagsArr} />
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成果类别" >
- <Select placeholder="选择成果类别" style={{ width: 120 }}
- value={this.state.orgDisplay}
- onChange={(e) => { this.setState({ orgDisplay: e }) }}>
- <Select.Option value="0" >个人</Select.Option>
- <Select.Option value="1" >组织</Select.Option>
- </Select>
- </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="备注" >
- {getFieldDecorator('remark', {
- initialValue: theData.remark
- })(
- <Input type="textarea" rows={4} placeholder="此处输入备注" />
- )}
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术图片" >
- <PicturesWall
- domId={'techAchievementQueryDesc2'}
- 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 }} >
- {
- maturityList.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="创新度" >
- {getFieldDecorator('innovation', {
- initialValue: theData.innovation
- })(
- <Select placeholder="选择创新度" style={{ width: 160 }} >
- {
- innovationList.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="成熟度证明材料(图片)" >
- <PicturesWall
- domId={'techAchievementQueryDesc3'}
- 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') {
- }
- 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 + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</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>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="自定义成果所有人" >
- <Switch checked={this.state.switchValue} onChange={(e) => { this.setState({ switchValue: e }); }} />
- </FormItem>
- {this.state.switchValue ? <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="成果所有人" >
- {getFieldDecorator('ownerName', {
- initialValue: theData.ownerName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系电话" >
- {getFieldDecorator('ownerMobile', {
- initialValue: theData.ownerMobile
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="证件号" >
- {getFieldDecorator('ownerIdNumber', {
- initialValue: theData.ownerIdNumber
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="电子邮箱" >
- {getFieldDecorator('ownerEmail', {
- initialValue: theData.ownerEmail
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="通讯地址" >
- {getFieldDecorator('ownerPostalAddress', {
- initialValue: theData.ownerPostalAddress
- })(
- <Input />
- )}
- </FormItem>
- </div> : <div className="clearfix" >
- <FormItem className="half-item"
- {...formItemLayout}
- label="成果所有人" >
- {getFieldDecorator('iOwnerName', {
- initialValue: theData.iOwnerName || ''
- })(
- <AutoComplete
- dataSource={this.state.dataSource}
- style={{ width: 200 }}
- onSearch={this.state.therottleSearch}
- placeholder="输入成果所有人"
- onSelect={(e) => {
- this.getContactsList(this.state.dataSourceObj[e]);
- }} />
- )}
- </FormItem>
- {this.props.detailApiUrl.indexOf('org') >= 0 ? <FormItem className="half-item"
- {...formItemLayout}
- label="联系人" >
- {getFieldDecorator('contacts', {
- initialValue: theData.contacts
- })(
- <Select style={{ width: 260 }}
- placeholder="请选择联系人"
- notFoundContent="未获取到联系人列表"
- showSearch
- filterOption={companySearch}>
- {this.state.contactsOption}
- </Select>
- )}
- </FormItem> : <div></div>}
- </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 }} >
- {
- transferModeList.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="议价方式" >
- {getFieldDecorator('bargainingMode', {
- initialValue: theData.bargainingMode
- })(
- <Radio.Group onChange={(e) => {
- this.setState({
- transferPriceDis: (e.target.value == 1 ? true : false)
- })
- }}>
- <Radio value="0">面议</Radio>
- <Radio value="1">定价</Radio>
- </Radio.Group>
- )}
- </FormItem>
- {this.state.transferPriceDis ? <FormItem className="half-item"
- {...formItemLayout}
- label="转让价格" >
- {getFieldDecorator('transferPrice', {
- initialValue: theData.transferPrice || 0
- })(
- <InputNumber min={0} max={999999} step={0.01} />
- )}
- <span style={{ marginLeft: '20px' }}>万元</span>
- </FormItem> : <div></div>}
- </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') {
- }
- 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') {
- }
- 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>
- </Spin>
- </Form >
- )
- }
- }));
- const AchievementDetail = React.createClass({
- getInitialState() {
- return {
- visible: false,
- tabsKey: 1,
- loading: false,
- columns: [
- {
- title: '编号',
- dataIndex: 'serialNumber',
- key: 'serialNumber',
- }, {
- title: '数据类型',
- dataIndex: 'dataCategory',
- key: 'dataCategory',
- render: text => {
- switch (text) {
- case "0":
- return <span>成果</span>;
- case "1":
- return <span>技术</span>;
- case "2":
- return <span>项目</span>;
- }
- }
- }, {
- title: '名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '关键字',
- dataIndex: 'keyword',
- key: 'keyword',
- }, {
- title: '类型',
- dataIndex: 'demandType',
- key: 'demandType',
- render: text => { return getDemandType(text); }
- }, {
- title: '所有人名称',
- dataIndex: 'theName',
- key: 'theName',
- }, {
- title: '发布时间',
- dataIndex: 'releaseDateFormattedDate',
- key: 'releaseDateFormattedDate',
- }, {
- title: '有效期限',
- dataIndex: 'validityPeriodFormattedDate',
- key: 'validityPeriodFormattedDate',
- },
- ],
- dataSource: [],
- };
- },
- getTechBrodersList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/audit/techBroders",
- 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 key={item}>{data.data[item]}</Select.Option>
- )
- };
- this.setState({
- techBrodersOption: theArr,
- techBrodersObj: data.data
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getTableList() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/achievementDemand",
- data: { id: this.props.data.id },
- success: function (data) {
- let theArr = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else if (data.data.length) {
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- theArr.push({
- key: i,
- id: thisdata.id,
- serialNumber: thisdata.serialNumber,
- dataCategory: thisdata.dataCategory,
- name: thisdata.name,
- keyword: thisdata.keyword,
- demandType: thisdata.demandType,
- theName: thisdata.username || thisdata.unitName,
- releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
- validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
- coverImg: thisdata.coverImg,
- hot: thisdata.hot,
- internationalFlag:thisdata.internationalFlag,
- });
- };
- };
- this.setState({
- dataSource: theArr,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- tableRowClick(record, index) {
- window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + record.id + '&type=' + record.dataCategory);
- },
- handleCancel(e) {
- this.setState({
- visible: false,
- });
- this.props.closeDesc(false);
- },
- handleOk(e) {
- this.setState({
- visible: false,
- });
- this.props.closeDesc(false, true);
- },
- componentWillMount() {
- this.getTechBrodersList();
- },
- componentWillReceiveProps(nextProps) {
- if (!this.state.visible && nextProps.showDesc) {
- this.state.tabsKey = "1";
- };
- this.state.visible = nextProps.showDesc;
- },
- render() {
- if (this.props.data) {
- return (
- <div className="patent-desc">
- <Modal maskClosable={false} visible={this.state.visible}
- onOk={this.checkPatentProcess} onCancel={this.handleCancel}
- width='1200px'
- footer=''
- className="admin-desc-content">
- <Spin spinning={this.state.loading}>
- <Tabs activeKey={this.state.tabsKey}
- onChange={(e) => {
- this.setState({ tabsKey: e });
- if (e == "2") {
- this.getTableList();
- };
- }} >
- <Tabs.TabPane tab="成果详情" key="1">
- {(() => {
- if (this.props.data.id && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
- return <AchievementDetailShow
- data={this.props.data}
- detailApiUrl={this.props.detailApiUrl}
- techBrodersOption={this.state.techBrodersOption}
- techBrodersObj={this.state.techBrodersObj}
- closeDesc={this.handleCancel}
- visible={this.state.visible}
- handleOk={this.handleOk} />
- } else {
- return <AchievementDetailForm
- data={this.props.data}
- detailApiUrl={this.props.detailApiUrl}
- achievementCategoryOption={this.props.achievementCategoryOption}
- techBrodersObj={this.state.techBrodersObj}
- closeDesc={this.handleCancel}
- visible={this.state.visible}
- handleOk={this.handleOk} />
- };
- })()}
- </Tabs.TabPane>
- <Tabs.TabPane tab="匹配列表" key="2" disabled={!this.props.data.id}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- pagination={false}
- style={{
- cursor: 'pointer',
- }}
- onRowClick={this.tableRowClick} />
- </Tabs.TabPane>
- </Tabs>
- </Spin>
- </Modal>
- </div>
- );
- } else {
- return <div></div>
- }
- },
- });
- export default AchievementDetail;
|