myClientDesc.jsx 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886
  1. import React from 'react';
  2. import { Tabs, Table, Icon, Tooltip, Modal, message, AutoComplete, Spin, DatePicker,Upload, Input, InputNumber, Select, Button, Radio, Form, Cascader, Tag, Switch } from 'antd';
  3. import './myClient.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import moment from 'moment';
  6. import $ from 'jquery/src/ajax';
  7. import { areaSelect } from '../../NewDicProvinceList';
  8. import { maturityList, innovationList, transferModeList,cityArr ,newFollow,customerStatus,intentionalService} from '../../dataDic';
  9. import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
  10. import { beforeUploadFile, splitUrl, companySearch, getTransferMode, getAchievementCategory, getTechAuditStatus, getDemandType, getMaturity, getInnovation,beforeUpload, getBase64,getsex,getCompanyIntention,getcityArr,getfllowSituation,getcustomerStatue} from '../../tools.js';
  11. import throttle from '../../throttle.js';
  12. const KeyWordTagGroup = React.createClass({
  13. getInitialState() {
  14. return {
  15. tags: [],
  16. inputVisible: false,
  17. inputValue: ''
  18. };
  19. },
  20. handleClose(removedTag) {
  21. const tags = this.state.tags.filter(tag => tag !== removedTag);
  22. this.props.tagsArr(tags);
  23. this.setState({ tags });
  24. },
  25. showInput() {
  26. this.setState({ inputVisible: true }, () => this.input.focus());
  27. },
  28. handleInputChange(e) {
  29. this.setState({ inputValue: e.target.value });
  30. },
  31. handleInputConfirm() {
  32. const state = this.state;
  33. const inputValue = state.inputValue;
  34. let tags = state.tags;
  35. if (inputValue && tags.indexOf(inputValue) === -1 && inputValue.replace(/(^\s*)|(\s*$)/g, "").length != 0) {
  36. tags = [...tags, inputValue.replace(/(^\s*)|(\s*$)/g, "")];
  37. };
  38. this.props.tagsArr(tags);
  39. this.setState({
  40. tags,
  41. inputVisible: false,
  42. inputValue: '',
  43. });
  44. },
  45. componentWillMount() {
  46. this.state.tags = this.props.keyWordArr;
  47. },
  48. componentWillReceiveProps(nextProps) {
  49. if (this.props.keyWordArr != nextProps.keyWordArr) {
  50. this.state.tags = nextProps.keyWordArr;
  51. };
  52. },
  53. render() {
  54. const { tags, inputVisible, inputValue } = this.state;
  55. return (
  56. <div className="keyWord-tips">
  57. {tags.map((tag, index) => {
  58. const isLongTag = tag.length > 10;
  59. const tagElem = (
  60. <Tag key={tag} closable={index !== -1} afterClose={() => this.handleClose(tag)}>
  61. {isLongTag ? `${tag.slice(0, 10)}...` : tag}
  62. </Tag>
  63. );
  64. return isLongTag ? <Tooltip key={tag} title={tag}>{tagElem}</Tooltip> : tagElem;
  65. })}
  66. {inputVisible && (
  67. <Input
  68. ref={input => this.input = input}
  69. type="text"
  70. style={{ width: 78 }}
  71. value={inputValue}
  72. onChange={this.handleInputChange}
  73. onBlur={this.handleInputConfirm}
  74. onPressEnter={this.handleInputConfirm}
  75. />
  76. )}
  77. {!inputVisible && <Button className="addtips" type="dashed" disabled={tags.length > 9 ? true : false} onClick={this.showInput}>+ 新关键词</Button>}
  78. </div>
  79. );
  80. }
  81. });
  82. const PicturesWall = React.createClass({
  83. getInitialState() {
  84. return {
  85. previewVisible: false,
  86. previewImage: '',
  87. fileList: [],
  88. }
  89. },
  90. handleCancel() {
  91. this.setState({ previewVisible: false })
  92. },
  93. handlePreview(file) {
  94. this.setState({
  95. previewImage: file.url || file.thumbUrl,
  96. previewVisible: true,
  97. });
  98. },
  99. handleChange(info) {
  100. let fileList = info.fileList;
  101. this.setState({ fileList });
  102. this.props.fileList(fileList);
  103. },
  104. componentWillReceiveProps(nextProps) {
  105. this.state.fileList = nextProps.pictureUrl;
  106. },
  107. render() {
  108. const { previewVisible, previewImage, fileList } = this.state;
  109. const uploadButton = (
  110. <div>
  111. <Icon type="plus" />
  112. <div className="ant-upload-text">点击上传</div>
  113. </div>
  114. );
  115. return (
  116. <div className="clearfix">
  117. <Upload
  118. action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
  119. data={{ 'sign': this.props.pictureSign }}
  120. listType="picture-card"
  121. fileList={fileList}
  122. onPreview={this.handlePreview}
  123. onChange={this.handleChange} >
  124. {fileList.length >= 5 ? null : uploadButton}
  125. </Upload>
  126. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  127. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  128. </Modal>
  129. </div>
  130. );
  131. }
  132. });
  133. const AchievementDetailShow = Form.create()(React.createClass({
  134. getInitialState() {
  135. return {
  136. loading: false,
  137. buttonLoading: false,
  138. contactsObj: {},
  139. data: {},
  140. tags: [],
  141. technicalPictureUrl: [],
  142. coverImg: [],
  143. maturityPictureUrl: [],
  144. textFileList: [],
  145. techPlanFileList: [],
  146. businessPlanFileList: []
  147. };
  148. },
  149. loadData(id, detailApiUrl) {
  150. this.setState({
  151. loading: true
  152. });
  153. $.ajax({
  154. method: "get",
  155. dataType: "json",
  156. crossDomain: false,
  157. url: globalConfig.context + detailApiUrl,
  158. data: {
  159. id: id
  160. },
  161. success: function (data) {
  162. let thisData = data.data;
  163. if (!thisData) {
  164. if (data.error && data.error.length) {
  165. message.warning(data.error[0].message);
  166. };
  167. thisData = {};
  168. };
  169. this.setState({
  170. data: thisData,
  171. orgDisplay: thisData.ownerType,
  172. switchValue: Boolean(!thisData.ownerId),
  173. radios:thisData.hot==='1'?true:false,
  174. tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
  175. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  176. coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
  177. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  178. });
  179. if (thisData.ownerId) {
  180. this.getContactsList(thisData.ownerId);
  181. };
  182. }.bind(this),
  183. }).always(function () {
  184. this.setState({
  185. loading: false
  186. });
  187. }.bind(this));
  188. },
  189. offShelf() {
  190. this.setState({
  191. loading: true
  192. });
  193. $.ajax({
  194. method: "post",
  195. dataType: "json",
  196. crossDomain: false,
  197. url: globalConfig.context + "/api/admin/achievement/offShelf",
  198. data: { "id": this.props.data.id }
  199. }).done(function (data) {
  200. if (!data.error.length) {
  201. message.success('撤销成功!');
  202. this.setState({
  203. visible: false,
  204. releaseSubmitVisible: false
  205. });
  206. this.props.handleOk();
  207. } else {
  208. message.warning(data.error[0].message);
  209. }
  210. }.bind(this));
  211. },
  212. modifyBroker() {
  213. this.props.form.validateFields((err, values) => {
  214. if (!err) {
  215. this.setState({
  216. loading: true
  217. });
  218. $.ajax({
  219. method: "POST",
  220. dataType: "json",
  221. crossDomain: false,
  222. url: globalConfig.context + '/api/admin/audit/modifyAchievementTechBroker',
  223. data: {
  224. id: this.props.data.id,
  225. techBrokerId: values.modifyTechBrokerId
  226. }
  227. }).done(function (data) {
  228. this.state.auditStatus = 0;
  229. this.setState({
  230. loading: false
  231. });
  232. if (data.error && data.error.length) {
  233. message.warning(data.error[0].message);
  234. } else {
  235. message.success('保存成功!');
  236. this.props.handleOk();
  237. };
  238. }.bind(this));
  239. }
  240. });
  241. },
  242. formSubmit() {
  243. this.props.form.validateFields((err, values) => {
  244. if (!err) {
  245. this.setState({
  246. loading: true
  247. });
  248. $.ajax({
  249. method: "POST",
  250. dataType: "json",
  251. crossDomain: false,
  252. url: globalConfig.context + '/api/admin/audit/achievement',
  253. data: {
  254. id: this.props.data.id,
  255. techBroderId: values.techBrokerId,
  256. auditStatus: values.auditStatus
  257. }
  258. }).done(function (data) {
  259. this.state.auditStatus = 0;
  260. this.setState({
  261. loading: false
  262. });
  263. if (!data.error.length) {
  264. message.success('保存成功!');
  265. this.setState({
  266. formSubmitVisible: false
  267. });
  268. this.props.handleOk();
  269. } else {
  270. message.warning(data.error[0].message);
  271. };
  272. }.bind(this));
  273. }
  274. });
  275. },
  276. handleSubmit(e) {
  277. e.preventDefault();
  278. this.props.form.validateFields((err, values) => {
  279. if (values.auditStatus == 4) {
  280. this.setState({
  281. formSubmitVisible: true
  282. });
  283. } else {
  284. this.formSubmit();
  285. };
  286. });
  287. },
  288. buildMatchList() {
  289. this.setState({
  290. buttonLoading: true
  291. });
  292. $.ajax({
  293. method: "POST",
  294. dataType: "json",
  295. crossDomain: false,
  296. url: globalConfig.context + '/api/admin/achievement/matchDemand',
  297. data: {
  298. id: this.props.data.id,
  299. }
  300. }).done(function (data) {
  301. this.setState({
  302. buttonLoading: false
  303. });
  304. if (!data.error.length) {
  305. message.success('匹配完成!匹配到' + data.data + '条记录');
  306. } else {
  307. message.warning(data.error[0].message);
  308. };
  309. }.bind(this));
  310. },
  311. getContactsList(theUid) {
  312. $.ajax({
  313. method: "get",
  314. dataType: "json",
  315. crossDomain: false,
  316. url: globalConfig.context + "/api/admin/findCustomer",
  317. data: {
  318. id: theUid
  319. },
  320. success: function (data) {
  321. if (!data.data) {
  322. if (data.error && data.error.length) {
  323. message.warning(data.error[0].message);
  324. return;
  325. };
  326. } else {
  327. this.setState({
  328. contactsObj: data.data || {}
  329. });
  330. };
  331. }.bind(this),
  332. });
  333. },
  334. componentWillMount() {
  335. this.loadData(this.props.data.id, this.props.detailApiUrl);
  336. },
  337. componentWillReceiveProps(nextProps) {
  338. if (!this.props.visible && nextProps.visible) {
  339. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  340. this.state.textFileList = [];
  341. this.state.techPlanFileList = [];
  342. this.state.businessPlanFileList = [];
  343. this.props.form.resetFields();
  344. };
  345. },
  346. render() {
  347. const theData = this.state.data || {};
  348. const { getFieldDecorator } = this.props.form;
  349. const FormItem = Form.Item
  350. const formItemLayout = {
  351. labelCol: { span: 8 },
  352. wrapperCol: { span: 14 },
  353. };
  354. return (
  355. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  356. <Spin spinning={this.state.loading}>
  357. <div className="clearfix">
  358. <FormItem className="half-item"
  359. {...formItemLayout}
  360. label="客户类型" >
  361. {(() => {
  362. switch (theData.customerTyp) {
  363. case "0":
  364. return <span>个人客户</span>;
  365. case "1":
  366. return <span>公司客户</span>;
  367. }
  368. })()}
  369. </FormItem>
  370. <FormItem className="half-item"
  371. {...formItemLayout}
  372. label="编号" >
  373. <span>{theData.id}</span>
  374. </FormItem>
  375. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
  376. </div>
  377. <FormItem className="half-item"
  378. {...formItemLayout}
  379. label="录入时间" >
  380. {getFieldDecorator('createTime', {
  381. initialValue: theData.createTime ? moment(theData.createTime) : null
  382. })(
  383. <DatePicker />
  384. )}
  385. </FormItem>
  386. <FormItem className="half-item"
  387. {...formItemLayout}
  388. label="跟单人" >
  389. {getFieldDecorator('ownerId', {
  390. initialValue: theData.ownerId
  391. })(
  392. <Input />
  393. )}
  394. </FormItem>
  395. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
  396. <div>
  397. <FormItem className="half-item"
  398. {...formItemLayout}
  399. label="公司名称" >
  400. {getFieldDecorator('companyName', {
  401. rules: [{ required: true, message: '此项为必填项!' }],
  402. initialValue: theData.companyName
  403. })(
  404. <Input />
  405. )}
  406. </FormItem>
  407. <FormItem className="half-item"
  408. {...formItemLayout}
  409. label="公司行业" >
  410. {getFieldDecorator('companyIndustry', {
  411. initialValue: theData.companyIndustry
  412. })(
  413. <Input />
  414. )}
  415. </FormItem>
  416. <FormItem className="half-item"
  417. {...formItemLayout}
  418. label="意向服务" >
  419. {getFieldDecorator('companyIntention', {
  420. rules: [{ required: true, message: '此项为必填项!' }],
  421. initialValue: theData.companyIntention
  422. })(
  423. <Select placeholder="选择服务类型" >
  424. {
  425. intentionalService.map(function (item) {
  426. return <Select.Option key={item.value} >{item.key}</Select.Option>
  427. })
  428. }
  429. </Select>
  430. )}
  431. </FormItem>
  432. <FormItem className="half-item"
  433. {...formItemLayout}
  434. label="地区" >
  435. {getFieldDecorator('locationProvince', {
  436. initialValue: theData.locationProvince
  437. })(
  438. <Select placeholder="选择地区" style={{ width: 160 }} >
  439. {
  440. cityArr.map(function (item) {
  441. return <Select.Option key={item.value} >{item.key}</Select.Option>
  442. })
  443. }
  444. </Select>
  445. )}
  446. </FormItem>
  447. <FormItem className="half-item"
  448. {...formItemLayout}
  449. label="最新跟进" >
  450. {getFieldDecorator('followSituation', {
  451. initialValue: theData.followSituation
  452. })(
  453. <Select placeholder="选择跟进进度" style={{ width: 160 }} >
  454. {
  455. newFollow.map(function (item) {
  456. return <Select.Option key={item.value} >{item.key}</Select.Option>
  457. })
  458. }
  459. </Select>
  460. )}
  461. </FormItem>
  462. <FormItem className="half-item"
  463. {...formItemLayout}
  464. label="客户状态" >
  465. {getFieldDecorator('customerStatue', {
  466. initialValue: theData.customerStatue
  467. })(
  468. <Select placeholder="选择客户状态" style={{ width: 160 }} >
  469. {
  470. customerStatus.map(function (item) {
  471. return <Select.Option key={item.value} >{item.key}</Select.Option>
  472. })
  473. }
  474. </Select>
  475. )}
  476. </FormItem>
  477. <FormItem className="half-item"
  478. {...formItemLayout}
  479. label="详细地址" >
  480. {getFieldDecorator('adress', {
  481. initialValue: theData.adress
  482. })(
  483. <Input />
  484. )}
  485. </FormItem>
  486. <div className="clearfix">
  487. <FormItem
  488. labelCol={{ span: 4 }}
  489. wrapperCol={{ span: 18 }}
  490. label="备注" >
  491. {getFieldDecorator('remarks', {
  492. initialValue: theData.remarks
  493. })(
  494. <Input type="textarea" rows={4} />
  495. )}
  496. </FormItem>
  497. </div>
  498. </div>
  499. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:</div>
  500. <div>
  501. <FormItem className="half-item"
  502. {...formItemLayout}
  503. label="姓名" >
  504. {getFieldDecorator('name', {
  505. rules: [{ required: true, message: '此项为必填项!' }],
  506. initialValue: theData.name
  507. })(
  508. <Input />
  509. )}
  510. </FormItem>
  511. <FormItem className="half-item"
  512. {...formItemLayout}
  513. label="性别" >
  514. {getFieldDecorator('sex', {
  515. rules: [{ required: true, message: '此项为必填项!' }],
  516. initialValue:getsex(theData.sex)
  517. })(
  518. <Radio.Group>
  519. <Radio value="0">男</Radio>
  520. <Radio value="1">女</Radio>
  521. </Radio.Group>
  522. )}
  523. </FormItem>
  524. <FormItem className="half-item"
  525. {...formItemLayout}
  526. label="手机号码" >
  527. {getFieldDecorator('telNum', {
  528. rules: [{ required: true, message: '此项为必填项!' }],
  529. initialValue: theData.telNum
  530. })(
  531. <Input />
  532. )}
  533. </FormItem>
  534. <FormItem className="half-item"
  535. {...formItemLayout}
  536. label="座机号" >
  537. {getFieldDecorator('mobile', {
  538. initialValue: theData.mobile
  539. })(
  540. <Input />
  541. )}
  542. </FormItem>
  543. <FormItem className="half-item"
  544. {...formItemLayout}
  545. label="QQ号码" >
  546. {getFieldDecorator('qq', {
  547. initialValue: theData.qq
  548. })(
  549. <Input />
  550. )}
  551. </FormItem>
  552. <FormItem className="half-item"
  553. {...formItemLayout}
  554. label="邮箱号" >
  555. {getFieldDecorator('email', {
  556. initialValue: theData.email
  557. })(
  558. <Input />
  559. )}
  560. </FormItem>
  561. <FormItem className="half-item"
  562. {...formItemLayout}
  563. label="微信" >
  564. {getFieldDecorator('wechat', {
  565. initialValue: theData.wechat
  566. })(
  567. <Input />
  568. )}
  569. </FormItem>
  570. <FormItem className="half-item"
  571. {...formItemLayout}
  572. label="部门" >
  573. {getFieldDecorator('depatrment', {
  574. initialValue: theData.depatrment
  575. })(
  576. <Input />
  577. )}
  578. </FormItem>
  579. <FormItem className="half-item"
  580. {...formItemLayout}
  581. label="职位" >
  582. {getFieldDecorator('customerPosition', {
  583. initialValue: theData.customerPosition
  584. })(
  585. <Input />
  586. )}
  587. </FormItem>
  588. </div>
  589. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  590. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep">保存</Button>
  591. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc} id='change_rem'>取消</Button>
  592. </FormItem>
  593. {/* <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  594. {theData.auditStatus == 2 ? <Button className="set-submit" type="primary" htmlType="submit">保存</Button> : <span></span>}
  595. {theData.auditStatus == 3 ? <Button className="set-submit" type="primary" onClick={() => { this.modifyBroker(); }}>保存</Button> : <span></span>}
  596. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button> */}
  597. {/*{window.showAuditStatus ? <Button className="set-submit" loading={this.state.buttonLoading} type="primary" onClick={this.buildMatchList}>生成匹配列表</Button> : <span></span>}*/}
  598. {/* </FormItem>
  599. */}
  600. </Spin>
  601. </Form >
  602. )
  603. }
  604. }));
  605. const AchievementDetailForm = Form.create()(React.createClass({
  606. getInitialState() {
  607. return {
  608. loading: false,
  609. auditStatus: 0,
  610. textFileList: [],
  611. switchValue: false,
  612. radios: false,
  613. techPlanFileList: [],
  614. data: {},
  615. tags: [],
  616. technicalPictureUrl: [],
  617. coverImg: [],
  618. maturityPictureUrl: [],
  619. businessPlanFileList: [],
  620. dataSource: [],
  621. };
  622. },
  623. loadData(id, detailApiUrl) {
  624. this.setState({
  625. loading: true
  626. });
  627. $.ajax({
  628. method: "get",
  629. dataType: "json",
  630. crossDomain: false,
  631. url: globalConfig.context + detailApiUrl,
  632. data: {
  633. id: id
  634. },
  635. success: function (data) {
  636. let thisData = data.data;
  637. if (!thisData) {
  638. if (data.error && data.error.length) {
  639. message.warning(data.error[0].message);
  640. };
  641. thisData = {};
  642. };
  643. this.setState({
  644. data: thisData,
  645. orgDisplay: thisData.ownerType,
  646. switchValue: Boolean(!thisData.ownerId),
  647. radios: thisData.hot == '1' ? true : false,
  648. transferPriceDis: thisData.transferMode == 1 ? true : false,
  649. tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
  650. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  651. coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
  652. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  653. });
  654. if (thisData.ownerType == "1" && thisData.ownerId) {
  655. this.getContactsList(thisData.ownerId);
  656. };
  657. }.bind(this),
  658. }).always(function () {
  659. this.setState({
  660. loading: false
  661. });
  662. }.bind(this));
  663. },
  664. getContactsList(theUid) {
  665. $.ajax({
  666. method: "get",
  667. dataType: "json",
  668. crossDomain: false,
  669. url: globalConfig.context + "/api/admin/getContacts",
  670. data: {
  671. uid: theUid
  672. },
  673. success: function (data) {
  674. let theOption = [];
  675. if (!data.data) {
  676. if (data.error && data.error.length) {
  677. message.warning(data.error[0].message);
  678. return;
  679. };
  680. };
  681. for (let item in data.data) {
  682. let theData = data.data[item];
  683. theOption.push(
  684. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  685. );
  686. };
  687. this.setState({
  688. contactsOption: theOption
  689. });
  690. }.bind(this),
  691. });
  692. },
  693. getTagsArr(e) {
  694. this.setState({ tags: e });
  695. },
  696. getMaturityPictureUrl(e) {
  697. this.setState({ maturityPictureUrl: e });
  698. },
  699. getTechnicalPictureUrl(e) {
  700. this.setState({ technicalPictureUrl: e });
  701. },
  702. getcoverImg(e) {
  703. this.setState({coverImg: e });
  704. },
  705. handleSearch(e) {
  706. if (this.props.detailApiUrl.indexOf('org') != -1) {
  707. $.ajax({
  708. method: "get",
  709. dataType: "json",
  710. crossDomain: false,
  711. url: globalConfig.context + "/api/admin/achievement/orgOwner",
  712. data: { name: e },
  713. success: function (data) {
  714. let theArr = [];
  715. let theObj = {};
  716. if (!data.data) {
  717. if (data.error && data.error.length) {
  718. message.warning(data.error[0].message);
  719. };
  720. } else if (!$.isEmptyObject(data.data)) {
  721. data.data.map(function (item) {
  722. theArr.push(item.unitName);
  723. theObj[item.unitName] = item.uid;
  724. });
  725. };
  726. this.setState({
  727. dataSource: theArr,
  728. dataSourceObj: theObj
  729. });
  730. }.bind(this),
  731. });
  732. } else {
  733. $.ajax({
  734. method: "get",
  735. dataType: "json",
  736. crossDomain: false,
  737. url: globalConfig.context + "/api/admin/achievement/userOwner",
  738. data: { name: e },
  739. success: function (data) {
  740. let theArr = [];
  741. let theObj = {};
  742. if (!data.data) {
  743. if (data.error && data.error.length) {
  744. message.warning(data.error[0].message);
  745. };
  746. } else if (!$.isEmptyObject(data.data)) {
  747. for (let item in data.data) {
  748. theArr.push(data.data[item]);
  749. theObj[data.data[item]] = item;
  750. };
  751. };
  752. this.setState({
  753. dataSource: theArr,
  754. dataSourceObj: theObj
  755. });
  756. }.bind(this),
  757. });
  758. };
  759. },
  760. handleSubmit(e) {
  761. e.preventDefault();
  762. this.props.form.validateFields((err, values) => {
  763. //url转化
  764. let theTechnicalPictureUrl = [];
  765. if (this.state.technicalPictureUrl.length) {
  766. let picArr = [];
  767. this.state.technicalPictureUrl.map(function (item) {
  768. picArr.push(item.response.data);
  769. });
  770. theTechnicalPictureUrl = picArr.join(",");
  771. };
  772. let thecoverImg = [];
  773. if (this.state.coverImg.length) {
  774. let picArr = [];
  775. this.state.coverImg.map(function (item) {
  776. picArr.push(item.response.data);
  777. });
  778. thecoverImg = picArr.join(",");
  779. };
  780. let theMaturityPictureUrl = [];
  781. if (this.state.maturityPictureUrl.length) {
  782. let picArr = [];
  783. this.state.maturityPictureUrl.map(function (item) {
  784. picArr.push(item.response.data);
  785. });
  786. theMaturityPictureUrl = picArr.join(",");
  787. };
  788. if (!err) {
  789. this.setState({
  790. loading: true
  791. });
  792. $.ajax({
  793. method: "POST",
  794. dataType: "json",
  795. crossDomain: false,
  796. url: this.props.data.id ? globalConfig.context + '/api/admin/customer/updCustomer' : globalConfig.context + '/api/admin/customer/addCustomer',
  797. data: {
  798. id: this.props.data.id, //编号
  799. customerTyp :values.customerTyp ,//客户信息 1
  800. createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\
  801. companyIntention: this.props.data.companyIntention,
  802. companyName: values.companyName,//公司名称 1
  803. companyIndustry: values.companyIndustry,//公司行业
  804. companyIntention: values.companyIntention,//公司意向1
  805. locationProvince: values.locationProvince,//省份1
  806. adress: values.adress,//详细地址1
  807. remarks: values.remarks,//备注1
  808. followSituation: values.followSituation,//最新跟进1
  809. customerStatue: values.customerStatue,//客户状态1
  810. name: values.name,//客户姓名1
  811. mobile: values.mobile,//座机1
  812. telNum: values.telNum,//手机号码1
  813. sex: values.sex,//性别1
  814. customerPosition: values.customerPosition,//职位1
  815. wechat: values.wechat,//微信号1
  816. qq: values.qq,//qq 1
  817. depatrment: values.depatrment,//部门 1
  818. email: values.email,//邮箱 1
  819. shareTyp:1,
  820. // keyword: this.state.tags ? this.state.tags.join(",") : this.props.tags.join(","),
  821. // keywords: this.state.tags ? this.state.tags : this.props.tags,
  822. // category: values.category,
  823. // summary: values.summary,
  824. // introduction: values.introduction,
  825. // technicalPictureUrl: theTechnicalPictureUrl,
  826. // coverImg: thecoverImg,
  827. // fieldA: values.field ? values.field[0] : undefined,
  828. // fieldB: values.field ? values.field[1] : undefined,
  829. // maturity: values.maturity,
  830. // maturityPictureUrl: theMaturityPictureUrl,
  831. // maturityTextFileUrl: this.state.maturityTextFileUrl,
  832. // maturityVideoUrl: values.maturityVideoUrl,
  833. // innovation: values.innovation,
  834. // //
  835. // switchSign: this.state.switchValue ? 1 : 0,
  836. // //
  837. // ownerId: !this.state.switchValue ? (this.state.dataSourceObj ? this.state.dataSourceObj[values.iOwnerName] : this.state.data.ownerId) : undefined,
  838. // contacts: !this.state.switchValue ? values.contacts : undefined,
  839. // ownerType: this.props.detailApiUrl.indexOf('org') != -1 ? 1 : 0,
  840. // //自定义
  841. // ownerName: this.state.switchValue ? values.ownerName : undefined,
  842. // ownerIdNumber: this.state.switchValue ? values.ownerIdNumber : undefined,
  843. // ownerId: this.state.switchValue ? values.ownerId : undefined,//拥有者
  844. // ownerEmail: this.state.switchValue ? values.ownerEmail : undefined,
  845. // ownerPostalAddress: this.state.switchValue ? values.ownerPostalAddress : undefined,
  846. // //
  847. // cooperationMode: values.cooperationMode,
  848. // transferMode: values.transferMode,
  849. // bargainingMode: values.bargainingMode,
  850. // transferPrice: values.transferPrice,
  851. // technicalScene: values.technicalScene,
  852. // breakthrough: values.breakthrough,
  853. // patentCase: values.patentCase,
  854. // awards: values.awards,
  855. // teamDes: values.teamDes,
  856. // parameter: values.parameter,
  857. // releaseStatus: values.releaseStatus,
  858. // techPlanUrl: this.state.techPlanUrl,
  859. // businessPlanUrl: this.state.businessPlanUrl,
  860. // auditStatus: this.state.auditStatus,
  861. // boutique: values.boutique,
  862. // hot: values.hot,
  863. }
  864. }).done(function (data) {
  865. this.state.auditStatus = 0;
  866. this.setState({
  867. loading: false
  868. });
  869. if (!data.error.length) {
  870. message.success('保存成功!');
  871. this.props.handleOk();
  872. } else {
  873. message.warning(data.error[0].message);
  874. }
  875. }.bind(this));
  876. }
  877. });
  878. },
  879. componentWillMount() {
  880. this.state.therottleSearch = throttle(this.handleSearch, 1000, { leading: false }).bind(this);
  881. if (this.props.data && this.props.data.id) {
  882. this.loadData(this.props.data.id, this.props.detailApiUrl);
  883. };
  884. },
  885. componentWillReceiveProps(nextProps) {
  886. if (!this.props.visible && nextProps.visible) {
  887. if (nextProps.data && nextProps.data.id) {
  888. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  889. };
  890. this.state.data = {};
  891. this.state.tags = [];
  892. this.state.switchValue = false;
  893. this.state.radios = false;
  894. this.state.technicalPictureUrl = [];
  895. this.state.coverImg = [];
  896. this.state.maturityPictureUrl = [];
  897. this.state.textFileList = [];
  898. this.state.techPlanFileList = [];
  899. this.state.businessPlanFileList = [];
  900. this.props.form.resetFields();
  901. };
  902. },
  903. render() {
  904. const theData = this.state.data || {};
  905. const { getFieldDecorator } = this.props.form;
  906. const FormItem = Form.Item
  907. const formItemLayout = {
  908. labelCol: { span: 8 },
  909. wrapperCol: { span: 14 },
  910. };
  911. return (
  912. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  913. <Spin spinning={this.state.loading}>
  914. <div className="clearfix">
  915. <FormItem className="half-item"
  916. {...formItemLayout}
  917. label="客户类型" >
  918. {getFieldDecorator('customerTyp', {
  919. rules: [{ required: true, message: '此项为必填项!' }],
  920. initialValue: theData.customerTyp
  921. })(
  922. <Select placeholder="选择客户类型" style={{ width: 160 }} >
  923. <Select.Option value="0" >个人客户</Select.Option>
  924. <Select.Option value="1" >公司客户</Select.Option>
  925. </Select>
  926. )}
  927. </FormItem>
  928. <FormItem className="half-item"
  929. {...formItemLayout}
  930. label="编号" >
  931. <span>{theData.id}</span>
  932. </FormItem>
  933. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
  934. <div>
  935. <FormItem className="half-item"
  936. {...formItemLayout}
  937. label="录入时间" >
  938. {getFieldDecorator('createTime', {
  939. initialValue: theData.createTime ? moment(theData.createTime) : null
  940. })(
  941. <DatePicker />
  942. )}
  943. </FormItem>
  944. <FormItem className="half-item"
  945. {...formItemLayout}
  946. label="跟单人" >
  947. {getFieldDecorator('ownerId', {
  948. initialValue: theData.ownerId
  949. })(
  950. <Input />
  951. )}
  952. </FormItem>
  953. </div>
  954. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
  955. <div>
  956. <FormItem className="half-item"
  957. {...formItemLayout}
  958. label="公司名称" >
  959. {getFieldDecorator('companyName', {
  960. rules: [{ required: true, message: '此项为必填项!' }],
  961. initialValue: theData.companyName
  962. })(
  963. <Input />
  964. )}
  965. </FormItem>
  966. <FormItem className="half-item"
  967. {...formItemLayout}
  968. label="公司行业" >
  969. {getFieldDecorator('companyIndustry', {
  970. initialValue: theData.companyIndustry
  971. })(
  972. <Input />
  973. )}
  974. </FormItem>
  975. <FormItem className="half-item"
  976. {...formItemLayout}
  977. label="意向服务" >
  978. {getFieldDecorator('companyIntention', {
  979. rules: [{ required: true, message: '此项为必填项!' }],
  980. initialValue: getCompanyIntention(theData.companyIntention)
  981. })(
  982. <Select placeholder="选择服务类型" >
  983. {
  984. intentionalService.map(function (item) {
  985. return <Select.Option key={item.value} >{item.key}</Select.Option>
  986. })
  987. }
  988. </Select>
  989. )}
  990. </FormItem>
  991. <FormItem className="half-item"
  992. {...formItemLayout}
  993. label="地区" >
  994. {getFieldDecorator('locationProvince', {
  995. initialValue: getcityArr(theData.locationProvince)
  996. })(
  997. <Select placeholder="选择地区" style={{ width: 160 }} >
  998. {
  999. cityArr.map(function (item) {
  1000. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1001. })
  1002. }
  1003. </Select>
  1004. )}
  1005. </FormItem>
  1006. <FormItem className="half-item"
  1007. {...formItemLayout}
  1008. label="最新跟进" >
  1009. {getFieldDecorator('followSituation', {
  1010. initialValue: getfllowSituation(theData.followSituation)
  1011. })(
  1012. <Select placeholder="选择跟进进度" style={{ width: 160 }} >
  1013. {
  1014. newFollow.map(function (item) {
  1015. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1016. })
  1017. }
  1018. </Select>
  1019. )}
  1020. </FormItem>
  1021. <FormItem className="half-item"
  1022. {...formItemLayout}
  1023. label="客户状态" >
  1024. {getFieldDecorator('customerStatue', {
  1025. initialValue: getcustomerStatue(theData.customerStatue)
  1026. })(
  1027. <Select placeholder="选择客户状态" style={{ width: 160 }} >
  1028. {
  1029. customerStatus.map(function (item) {
  1030. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1031. })
  1032. }
  1033. </Select>
  1034. )}
  1035. </FormItem>
  1036. <FormItem className="half-item"
  1037. {...formItemLayout}
  1038. label="详细地址" >
  1039. {getFieldDecorator('adress', {
  1040. initialValue: theData.adress
  1041. })(
  1042. <Input />
  1043. )}
  1044. </FormItem>
  1045. <div className="clearfix">
  1046. <FormItem
  1047. labelCol={{ span: 4 }}
  1048. wrapperCol={{ span: 18 }}
  1049. label="备注" >
  1050. {getFieldDecorator('remarks', {
  1051. initialValue: theData.remarks
  1052. })(
  1053. <Input type="textarea" rows={4} />
  1054. )}
  1055. </FormItem>
  1056. </div>
  1057. </div>
  1058. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:</div>
  1059. <div>
  1060. <FormItem className="half-item"
  1061. {...formItemLayout}
  1062. label="姓名" >
  1063. {getFieldDecorator('name', {
  1064. rules: [{ required: true, message: '此项为必填项!' }],
  1065. initialValue: theData.name
  1066. })(
  1067. <Input />
  1068. )}
  1069. </FormItem>
  1070. <FormItem className="half-item"
  1071. {...formItemLayout}
  1072. label="性别" >
  1073. {getFieldDecorator('sex', {
  1074. rules: [{ required: true, message: '此项为必填项!' }],
  1075. initialValue: getsex(theData.sex)
  1076. })(
  1077. <Radio.Group>
  1078. <Radio value="0">男</Radio>
  1079. <Radio value="1">女</Radio>
  1080. </Radio.Group>
  1081. )}
  1082. </FormItem>
  1083. <FormItem className="half-item"
  1084. {...formItemLayout}
  1085. label="手机号码" >
  1086. {getFieldDecorator('telNum', {
  1087. initialValue: theData.telNum
  1088. })(
  1089. <Input />
  1090. )}
  1091. </FormItem>
  1092. <FormItem className="half-item"
  1093. {...formItemLayout}
  1094. label="座机号" >
  1095. {getFieldDecorator('mobile', {
  1096. initialValue: theData.mobile
  1097. })(
  1098. <Input />
  1099. )}
  1100. </FormItem>
  1101. <FormItem className="half-item"
  1102. {...formItemLayout}
  1103. label="QQ号码" >
  1104. {getFieldDecorator('qq', {
  1105. initialValue: theData.qq
  1106. })(
  1107. <Input />
  1108. )}
  1109. </FormItem>
  1110. <FormItem className="half-item"
  1111. {...formItemLayout}
  1112. label="邮箱号" >
  1113. {getFieldDecorator('email', {
  1114. initialValue: theData.email
  1115. })(
  1116. <Input />
  1117. )}
  1118. </FormItem>
  1119. <FormItem className="half-item"
  1120. {...formItemLayout}
  1121. label="微信" >
  1122. {getFieldDecorator('wechat', {
  1123. initialValue: theData.wechat
  1124. })(
  1125. <Input />
  1126. )}
  1127. </FormItem>
  1128. <FormItem className="half-item"
  1129. {...formItemLayout}
  1130. label="部门" >
  1131. {getFieldDecorator('depatrment', {
  1132. initialValue: theData.depatrment
  1133. })(
  1134. <Input />
  1135. )}
  1136. </FormItem>
  1137. <FormItem className="half-item"
  1138. {...formItemLayout}
  1139. label="职位" >
  1140. {getFieldDecorator('customerPosition', {
  1141. initialValue: theData.customerPosition
  1142. })(
  1143. <Input />
  1144. )}
  1145. </FormItem>
  1146. </div>
  1147. {/* <FormItem className="half-item"
  1148. {...formItemLayout}
  1149. label="编号" >
  1150. <span>{theData.serialNumber}</span>
  1151. </FormItem>
  1152. <FormItem className="half-item"
  1153. {...formItemLayout}
  1154. label="名称" >
  1155. {getFieldDecorator('name', {
  1156. rules: [{ required: true, message: '此项为必填项!' }],
  1157. initialValue: theData.name
  1158. })(
  1159. <Input />
  1160. )}
  1161. </FormItem>
  1162. <FormItem className="half-item"
  1163. {...formItemLayout}
  1164. label="数据类别" >
  1165. {getFieldDecorator('dataCategory', {
  1166. rules: [{ required: true, message: '此项为必填项!' }],
  1167. initialValue: theData.dataCategory
  1168. })(
  1169. <Select placeholder="选择数据类型" style={{ width: 160 }} >
  1170. <Select.Option value="0" >成果</Select.Option>
  1171. <Select.Option value="1" >技术</Select.Option>
  1172. <Select.Option value="2" >项目</Select.Option>
  1173. </Select>
  1174. )}
  1175. </FormItem>
  1176. <FormItem className="half-item"
  1177. {...formItemLayout}
  1178. label="类型" >
  1179. {getFieldDecorator('category', {
  1180. rules: [{ required: true, message: '此项为必填项!' }],
  1181. initialValue: theData.category
  1182. })(
  1183. <Select style={{ width: 160 }} placeholder="请选择成果类型">
  1184. {this.props.achievementCategoryOption}
  1185. </Select>
  1186. )}
  1187. </FormItem>
  1188. <FormItem className="half-item"
  1189. {...formItemLayout}
  1190. label="精品成果" >
  1191. {getFieldDecorator('boutique', {
  1192. initialValue: theData.boutique
  1193. })(
  1194. <Radio.Group>
  1195. <Radio value="0">否</Radio>
  1196. <Radio value="1">是</Radio>
  1197. </Radio.Group>
  1198. )}
  1199. </FormItem>
  1200. <FormItem className="half-item"
  1201. {...formItemLayout}
  1202. label="首页展示:" >
  1203. {getFieldDecorator('hot', {
  1204. initialValue: theData.hot
  1205. })(
  1206. <Radio.Group onChange={(e) => { this.setState({ radios: e.target.value }); }}>
  1207. <Radio value="0">否</Radio>
  1208. <Radio value="1">是</Radio>
  1209. </Radio.Group>
  1210. )}
  1211. </FormItem>
  1212. {this.state.radios==true ? <FormItem
  1213. labelCol={{ span: 4 }}
  1214. wrapperCol={{ span: 18 }}
  1215. label="首页展示图片:" >
  1216. <PicturesWall
  1217. pictureSign="achievement_cover_picture"
  1218. fileList={this.getcoverImg}
  1219. pictureUrl={this.state.coverImg} />
  1220. <p>图片尺寸建议:220X140(像素)</p>
  1221. </FormItem>:<div></div>}
  1222. <div className="clearfix">
  1223. <FormItem className="half-item"
  1224. {...formItemLayout}
  1225. label="是否发布" >
  1226. {(() => {
  1227. switch (theData.releaseStatus) {
  1228. case "0":
  1229. return <span>未发布</span>;
  1230. case "1":
  1231. return <span>已发布</span>;
  1232. }
  1233. })()}
  1234. </FormItem>
  1235. <FormItem className="half-item"
  1236. {...formItemLayout}
  1237. label="发布时间" >
  1238. <span>{theData.releaseDateFormattedDate}</span>
  1239. </FormItem>
  1240. <FormItem className="half-item"
  1241. {...formItemLayout}
  1242. label="审核状态" >
  1243. <span>{getTechAuditStatus(theData.auditStatus)}</span>
  1244. </FormItem>
  1245. </div>
  1246. */}
  1247. </div>
  1248. {/*
  1249. <FormItem
  1250. labelCol={{ span: 4 }}
  1251. wrapperCol={{ span: 18 }}
  1252. label="关键词" >
  1253. <KeyWordTagGroup
  1254. keyWordArr={this.state.tags}
  1255. tagsArr={this.getTagsArr} />
  1256. </FormItem>
  1257. <FormItem
  1258. labelCol={{ span: 4 }}
  1259. wrapperCol={{ span: 18 }}
  1260. label="摘要" >
  1261. {getFieldDecorator('summary', {
  1262. initialValue: theData.summary
  1263. })(
  1264. <Input type="textarea" rows={4} />
  1265. )}
  1266. </FormItem>
  1267. <FormItem
  1268. labelCol={{ span: 4 }}
  1269. wrapperCol={{ span: 18 }}
  1270. label="成果简介" >
  1271. {getFieldDecorator('introduction', {
  1272. initialValue: theData.introduction
  1273. })(
  1274. <Input type="textarea" rows={4} placeholder="项目成果简介;项目核心创新点;项目详细用途;预期效益说明;主要技术(性能)指标;市场前景;应用范围;发展历程。" />
  1275. )}
  1276. </FormItem>
  1277. <FormItem
  1278. labelCol={{ span: 4 }}
  1279. wrapperCol={{ span: 18 }}
  1280. label="技术图片" >
  1281. <PicturesWall
  1282. pictureSign="achievement_technical_picture"
  1283. fileList={this.getTechnicalPictureUrl}
  1284. pictureUrl={this.state.technicalPictureUrl} />
  1285. <p>图片建议:专利证书或专利申请书图片、技术图纸、样品图片、技术相关网络图片;成熟度处于非研发阶段的项目,必须上传样品图片,如未上传,成熟度将视为处在研发阶段。</p>
  1286. </FormItem>
  1287. <FormItem
  1288. labelCol={{ span: 4 }}
  1289. wrapperCol={{ span: 18 }}
  1290. label="应用领域" >
  1291. {getFieldDecorator('field', {
  1292. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  1293. initialValue: [theData.fieldA, theData.fieldB]
  1294. })(
  1295. <Cascader style={{ width: 300 }} options={IndustryObject} placeholder="应用领域" />
  1296. )}
  1297. </FormItem>
  1298. <div className="clearfix">
  1299. <FormItem className="half-item"
  1300. {...formItemLayout}
  1301. label="成熟度" >
  1302. {getFieldDecorator('maturity', {
  1303. initialValue: theData.maturity
  1304. })(
  1305. <Select placeholder="选择成熟度" style={{ width: 160 }} >
  1306. {
  1307. maturityList.map(function (item) {
  1308. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1309. })
  1310. }
  1311. </Select>
  1312. )}
  1313. </FormItem>
  1314. <FormItem className="half-item"
  1315. {...formItemLayout}
  1316. label="创新度" >
  1317. {getFieldDecorator('innovation', {
  1318. initialValue: theData.innovation
  1319. })(
  1320. <Select placeholder="选择创新度" style={{ width: 160 }} >
  1321. {
  1322. innovationList.map(function (item) {
  1323. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1324. })
  1325. }
  1326. </Select>
  1327. )}
  1328. </FormItem>
  1329. </div>
  1330. <FormItem
  1331. labelCol={{ span: 4 }}
  1332. wrapperCol={{ span: 18 }}
  1333. label="成熟度证明材料(图片)" >
  1334. <PicturesWall
  1335. pictureSign="achievement_maturity_picture"
  1336. fileList={this.getMaturityPictureUrl}
  1337. pictureUrl={this.state.maturityPictureUrl} />
  1338. </FormItem>
  1339. <FormItem
  1340. labelCol={{ span: 4 }}
  1341. wrapperCol={{ span: 6 }}
  1342. label="成熟度证明材料(文本)" >
  1343. <Upload
  1344. name="ratepay"
  1345. action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
  1346. data={{ 'sign': 'achievement_maturity_text_file' }}
  1347. beforeUpload={beforeUploadFile}
  1348. fileList={this.state.textFileList}
  1349. onChange={(info) => {
  1350. if (info.file.status !== 'uploading') {
  1351. console.log(info.file, info.fileList);
  1352. }
  1353. if (info.file.status === 'done') {
  1354. if (!info.file.response.error.length) {
  1355. message.success(`${info.file.name} 文件上传成功!`);
  1356. } else {
  1357. message.warning(info.file.response.error[0].message);
  1358. return;
  1359. };
  1360. this.state.maturityTextFileUrl = info.file.response.data;
  1361. } else if (info.file.status === 'error') {
  1362. message.error(`${info.file.name} 文件上传失败。`);
  1363. };
  1364. this.setState({ textFileList: info.fileList.slice(-1) });
  1365. }} >
  1366. <Button><Icon type="upload" /> 上传成熟度证明文本 </Button>
  1367. </Upload>
  1368. <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
  1369. <span className="download-file">
  1370. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
  1371. </span>
  1372. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1373. </FormItem>
  1374. <FormItem
  1375. labelCol={{ span: 4 }}
  1376. wrapperCol={{ span: 18 }}
  1377. label="成熟度证明材料(视频地址)" >
  1378. {getFieldDecorator('maturityVideoUrl', {
  1379. initialValue: theData.maturityVideoUrl
  1380. })(
  1381. <Input />
  1382. )}
  1383. </FormItem>
  1384. <FormItem
  1385. labelCol={{ span: 4 }}
  1386. wrapperCol={{ span: 18 }}
  1387. label="自定义成果所有人" >
  1388. <Switch checked={this.state.switchValue} onChange={(e) => { this.setState({ switchValue: e }); }} />
  1389. </FormItem>
  1390. {this.state.switchValue ? <div className="clearfix" >
  1391. <FormItem className="half-item"
  1392. {...formItemLayout}
  1393. label="成果所有人" >
  1394. {getFieldDecorator('ownerName', {
  1395. initialValue: theData.ownerName
  1396. })(
  1397. <Input />
  1398. )}
  1399. </FormItem>
  1400. <FormItem className="half-item"
  1401. {...formItemLayout}
  1402. label="联系电话" >
  1403. {getFieldDecorator('ownerMobile', {
  1404. initialValue: theData.ownerMobile
  1405. })(
  1406. <Input />
  1407. )}
  1408. </FormItem>
  1409. <FormItem className="half-item"
  1410. {...formItemLayout}
  1411. label="证件号" >
  1412. {getFieldDecorator('ownerIdNumber', {
  1413. initialValue: theData.ownerIdNumber
  1414. })(
  1415. <Input />
  1416. )}
  1417. </FormItem>
  1418. <FormItem className="half-item"
  1419. {...formItemLayout}
  1420. label="电子邮箱" >
  1421. {getFieldDecorator('ownerEmail', {
  1422. initialValue: theData.ownerEmail
  1423. })(
  1424. <Input />
  1425. )}
  1426. </FormItem>
  1427. <FormItem className="half-item"
  1428. {...formItemLayout}
  1429. label="通讯地址" >
  1430. {getFieldDecorator('ownerPostalAddress', {
  1431. initialValue: theData.ownerPostalAddress
  1432. })(
  1433. <Input />
  1434. )}
  1435. </FormItem>
  1436. </div> : <div className="clearfix" >
  1437. <FormItem className="half-item"
  1438. {...formItemLayout}
  1439. label="成果所有人" >
  1440. {getFieldDecorator('iOwnerName', {
  1441. initialValue: theData.iOwnerName || ''
  1442. })(
  1443. <AutoComplete
  1444. dataSource={this.state.dataSource}
  1445. style={{ width: 200 }}
  1446. onSearch={this.state.therottleSearch}
  1447. placeholder="输入成果所有人"
  1448. onSelect={(e) => {
  1449. this.getContactsList(this.state.dataSourceObj[e]);
  1450. }} />
  1451. )}
  1452. </FormItem>
  1453. {this.props.detailApiUrl.indexOf('org') >= 0 ? <FormItem className="half-item"
  1454. {...formItemLayout}
  1455. label="联系人" >
  1456. {getFieldDecorator('contacts', {
  1457. initialValue: theData.contacts
  1458. })(
  1459. <Select style={{ width: 260 }}
  1460. placeholder="请选择联系人"
  1461. notFoundContent="未获取到联系人列表"
  1462. showSearch
  1463. filterOption={companySearch}>
  1464. {this.state.contactsOption}
  1465. </Select>
  1466. )}
  1467. </FormItem> : <div></div>}
  1468. </div>}
  1469. <div className="clearfix">
  1470. <FormItem className="half-item"
  1471. {...formItemLayout}
  1472. label="合作方式" >
  1473. {getFieldDecorator('cooperationMode', {
  1474. rules: [{ required: true, message: '此项为必填项!' }],
  1475. initialValue: theData.cooperationMode
  1476. })(
  1477. <Radio.Group>
  1478. <Radio value="0">技术转让</Radio>
  1479. <Radio value="1">授权生产</Radio>
  1480. </Radio.Group>
  1481. )}
  1482. </FormItem>
  1483. <FormItem className="half-item"
  1484. {...formItemLayout}
  1485. label="转让方式" >
  1486. {getFieldDecorator('transferMode', {
  1487. initialValue: theData.transferMode
  1488. })(
  1489. <Select placeholder="选择转让方式" style={{ width: 160 }} >
  1490. {
  1491. transferModeList.map(function (item) {
  1492. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1493. })
  1494. }
  1495. </Select>
  1496. )}
  1497. </FormItem>
  1498. </div>
  1499. <div className="clearfix">
  1500. <FormItem className="half-item"
  1501. {...formItemLayout}
  1502. label="议价方式" >
  1503. {getFieldDecorator('bargainingMode', {
  1504. initialValue: theData.bargainingMode
  1505. })(
  1506. <Radio.Group onChange={(e) => {
  1507. this.setState({
  1508. transferPriceDis: (e.target.value == 1 ? true : false)
  1509. })
  1510. }}>
  1511. <Radio value="0">面议</Radio>
  1512. <Radio value="1">定价</Radio>
  1513. </Radio.Group>
  1514. )}
  1515. </FormItem>
  1516. {this.state.transferPriceDis ? <FormItem className="half-item"
  1517. {...formItemLayout}
  1518. label="转让价格" >
  1519. {getFieldDecorator('transferPrice', {
  1520. initialValue: theData.transferPrice || 0
  1521. })(
  1522. <InputNumber min={0} max={999999} step={0.01} />
  1523. )}
  1524. <span style={{ marginLeft: '20px' }}>万元</span>
  1525. </FormItem> : <div></div>}
  1526. </div>
  1527. <FormItem
  1528. labelCol={{ span: 4 }}
  1529. wrapperCol={{ span: 18 }}
  1530. label="技术场景" >
  1531. {getFieldDecorator('technicalScene', {
  1532. initialValue: theData.technicalScene
  1533. })(
  1534. <Input type="textarea" rows={2} placeholder="说明解决了什么问题。" />
  1535. )}
  1536. </FormItem>
  1537. <FormItem
  1538. labelCol={{ span: 4 }}
  1539. wrapperCol={{ span: 18 }}
  1540. label="技术突破" >
  1541. {getFieldDecorator('breakthrough', {
  1542. initialValue: theData.breakthrough
  1543. })(
  1544. <Input type="textarea" rows={2} placeholder="说明该技术成果突破性的研究。" />
  1545. )}
  1546. </FormItem>
  1547. <FormItem
  1548. labelCol={{ span: 4 }}
  1549. wrapperCol={{ span: 18 }}
  1550. label="专利情况" >
  1551. {getFieldDecorator('patentCase', {
  1552. initialValue: theData.patentCase
  1553. })(
  1554. <Input type="textarea" rows={2} placeholder="一个“技术”可能由多个专利构成,需要说明技术-专利的关系。" />
  1555. )}
  1556. </FormItem>
  1557. <FormItem
  1558. labelCol={{ span: 4 }}
  1559. wrapperCol={{ span: 18 }}
  1560. label="获奖情况" >
  1561. {getFieldDecorator('awards', {
  1562. initialValue: theData.awards
  1563. })(
  1564. <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
  1565. )}
  1566. </FormItem>
  1567. <FormItem
  1568. labelCol={{ span: 4 }}
  1569. wrapperCol={{ span: 18 }}
  1570. label="技术团队情况" >
  1571. {getFieldDecorator('teamDes', {
  1572. initialValue: theData.teamDes
  1573. })(
  1574. <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
  1575. )}
  1576. </FormItem>
  1577. <FormItem
  1578. labelCol={{ span: 4 }}
  1579. wrapperCol={{ span: 18 }}
  1580. label="技术参数" >
  1581. {getFieldDecorator('parameter', {
  1582. initialValue: theData.parameter
  1583. })(
  1584. <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
  1585. )}
  1586. </FormItem>
  1587. <FormItem
  1588. labelCol={{ span: 4 }}
  1589. wrapperCol={{ span: 6 }}
  1590. label="技术方案" >
  1591. <Upload
  1592. name="ratepay"
  1593. action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
  1594. data={{ 'sign': 'achievement_tech_plan' }}
  1595. beforeUpload={beforeUploadFile}
  1596. fileList={this.state.techPlanFileList}
  1597. onChange={(info) => {
  1598. if (info.file.status !== 'uploading') {
  1599. console.log(info.file, info.fileList);
  1600. }
  1601. if (info.file.status === 'done') {
  1602. if (!info.file.response.error.length) {
  1603. message.success(`${info.file.name} 文件上传成功!`);
  1604. } else {
  1605. message.warning(info.file.response.error[0].message);
  1606. return;
  1607. };
  1608. this.state.techPlanUrl = info.file.response.data;
  1609. } else if (info.file.status === 'error') {
  1610. message.error(`${info.file.name} 文件上传失败。`);
  1611. };
  1612. this.setState({ techPlanFileList: info.fileList.slice(-1) });
  1613. }} >
  1614. <Button><Icon type="upload" /> 上传技术方案文件 </Button>
  1615. </Upload>
  1616. <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
  1617. <span className="download-file">
  1618. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
  1619. </span>
  1620. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1621. </FormItem>
  1622. <FormItem
  1623. labelCol={{ span: 4 }}
  1624. wrapperCol={{ span: 6 }}
  1625. label="商业计划书" >
  1626. <Upload
  1627. name="ratepay"
  1628. action={globalConfig.context + "/api/admin/achievement/uploadTextFile"}
  1629. data={{ 'sign': 'achievement_business_plan' }}
  1630. beforeUpload={beforeUploadFile}
  1631. fileList={this.state.businessPlanFileList}
  1632. onChange={(info) => {
  1633. if (info.file.status !== 'uploading') {
  1634. console.log(info.file, info.fileList);
  1635. }
  1636. if (info.file.status === 'done') {
  1637. if (!info.file.response.error.length) {
  1638. message.success(`${info.file.name} 文件上传成功!`);
  1639. } else {
  1640. message.warning(info.file.response.error[0].message);
  1641. return;
  1642. };
  1643. this.state.businessPlanUrl = info.file.response.data;
  1644. } else if (info.file.status === 'error') {
  1645. message.error(`${info.file.name} 文件上传失败。`);
  1646. };
  1647. this.setState({ businessPlanFileList: info.fileList.slice(-1) });
  1648. }} >
  1649. <Button><Icon type="upload" /> 上传商业计划书文件 </Button>
  1650. </Upload>
  1651. <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
  1652. <span className="download-file">
  1653. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
  1654. </span>
  1655. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1656. </FormItem>
  1657. */}
  1658. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1659. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1660. {/*<Button className="set-submit" type="ghost" onClick={(e) => { this.state.auditStatus = 1; }} htmlType="submit">发布</Button>*/}
  1661. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  1662. </FormItem>
  1663. </Spin>
  1664. </Form >
  1665. )
  1666. }
  1667. }));
  1668. const AchievementDetail = React.createClass({
  1669. getInitialState() {
  1670. return {
  1671. visible: false,
  1672. tabsKey: 1,
  1673. loading: false,
  1674. columns: [
  1675. {
  1676. title: '客户信息',
  1677. dataIndex: 'id',
  1678. key: 'id',
  1679. render: text => {
  1680. switch (text) {
  1681. case "0":
  1682. return <span>个人客户</span>;
  1683. case "1":
  1684. return <span>公司客户</span>;
  1685. }
  1686. }
  1687. }, {
  1688. title: '名称',
  1689. dataIndex: 'companyNmae',
  1690. key: 'companyNmae',
  1691. }, {
  1692. title: '关键字',
  1693. dataIndex: 'keyword',
  1694. key: 'keyword',
  1695. }, {
  1696. title: '类型',
  1697. dataIndex: 'demandType',
  1698. key: 'demandType',
  1699. render: text => { return getDemandType(text); }
  1700. }, {
  1701. title: '所有人名称',
  1702. dataIndex: 'theName',
  1703. key: 'theName',
  1704. }, {
  1705. title: '发布时间',
  1706. dataIndex: 'releaseDateFormattedDate',
  1707. key: 'releaseDateFormattedDate',
  1708. }, {
  1709. title: '有效期限',
  1710. dataIndex: 'validityPeriodFormattedDate',
  1711. key: 'validityPeriodFormattedDate',
  1712. },
  1713. ],
  1714. dataSource: [],
  1715. };
  1716. },
  1717. getTechBrodersList() {
  1718. this.setState({
  1719. loading: true
  1720. });
  1721. $.ajax({
  1722. method: "get",
  1723. dataType: "json",
  1724. crossDomain: false,
  1725. url: globalConfig.context + "/api/admin/audit/techBroders",
  1726. success: function (data) {
  1727. if (!data.data) {
  1728. if (data.error && data.error.length) {
  1729. message.warning(data.error[0].message);
  1730. }
  1731. return;
  1732. };
  1733. let _me = this, theArr = [];
  1734. for (var item in data.data) {
  1735. theArr.push(
  1736. <Select.Option key={item}>{data.data[item]}</Select.Option>
  1737. )
  1738. };
  1739. this.setState({
  1740. techBrodersOption: theArr,
  1741. techBrodersObj: data.data
  1742. });
  1743. }.bind(this),
  1744. }).always(function () {
  1745. this.setState({
  1746. loading: false
  1747. });
  1748. }.bind(this));
  1749. },
  1750. getTableList() {
  1751. this.setState({
  1752. loading: true
  1753. });
  1754. $.ajax({
  1755. method: "get",
  1756. dataType: "json",
  1757. crossDomain: false,
  1758. url: globalConfig.context + "/api/admin/achievement/achievementDemand",
  1759. data: { id: this.props.data.id },
  1760. success: function (data) {
  1761. let theArr = [];
  1762. if (!data.data) {
  1763. if (data.error && data.error.length) {
  1764. message.warning(data.error[0].message);
  1765. };
  1766. } else if (data.data.length) {
  1767. for (let i = 0; i < data.data.length; i++) {
  1768. let thisdata = data.data[i];
  1769. theArr.push({
  1770. key: i,
  1771. id: thisdata.id,
  1772. serialNumber: thisdata.serialNumber,
  1773. createTime: thisdata.createTime,
  1774. name: thisdata.name,
  1775. keyword: thisdata.keyword,
  1776. demandType: thisdata.demandType,
  1777. theName: thisdata.username || thisdata.unitName,
  1778. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  1779. validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
  1780. coverImg: thisdata.coverImg,
  1781. hot: thisdata.hot,
  1782. });
  1783. };
  1784. };
  1785. this.setState({
  1786. dataSource: theArr,
  1787. });
  1788. }.bind(this),
  1789. }).always(function () {
  1790. this.setState({
  1791. loading: false
  1792. });
  1793. }.bind(this));
  1794. },
  1795. tableRowClick(record, index) {
  1796. window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + record.id + '&type=' + record.dataCategory);
  1797. },
  1798. handleCancel(e) {
  1799. this.setState({
  1800. visible: false,
  1801. });
  1802. this.props.closeDesc(false);
  1803. },
  1804. handleOk(e) {
  1805. this.setState({
  1806. visible: false,
  1807. });
  1808. this.props.closeDesc(false, true);
  1809. },
  1810. componentWillMount() {
  1811. this.getTechBrodersList();
  1812. },
  1813. componentWillReceiveProps(nextProps) {
  1814. if (!this.state.visible && nextProps.showDesc) {
  1815. this.state.tabsKey = "1";
  1816. };
  1817. this.state.visible = nextProps.showDesc;
  1818. },
  1819. render() {
  1820. if (this.props.data) {
  1821. return (
  1822. <div className="patent-desc">
  1823. <Modal maskClosable={false} visible={this.state.visible}
  1824. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1825. width='1000px'
  1826. footer=''
  1827. className="admin-desc-content">
  1828. <Spin spinning={this.state.loading}>
  1829. <Tabs activeKey={this.state.tabsKey}
  1830. onChange={(e) => {
  1831. this.setState({ tabsKey: e });
  1832. if (e == "2") {
  1833. this.getTableList();
  1834. };
  1835. }} >
  1836. <Tabs.TabPane tab="客户详情" key="1">
  1837. {(() => {
  1838. if (this.props.data.id && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
  1839. return <AchievementDetailShow
  1840. data={this.props.data}
  1841. detailApiUrl={this.props.detailApiUrl}
  1842. techBrodersOption={this.state.techBrodersOption}
  1843. techBrodersObj={this.state.techBrodersObj}
  1844. closeDesc={this.handleCancel}
  1845. visible={this.state.visible}
  1846. handleOk={this.handleOk} />
  1847. } else {
  1848. return <AchievementDetailForm
  1849. data={this.props.data}
  1850. detailApiUrl={this.props.detailApiUrl}
  1851. achievementCategoryOption={this.props.achievementCategoryOption}
  1852. techBrodersObj={this.state.techBrodersObj}
  1853. closeDesc={this.handleCancel}
  1854. visible={this.state.visible}
  1855. handleOk={this.handleOk} />
  1856. };
  1857. })()}
  1858. </Tabs.TabPane>
  1859. </Tabs>
  1860. </Spin>
  1861. </Modal>
  1862. </div>
  1863. );
  1864. } else {
  1865. return <div></div>
  1866. }
  1867. },
  1868. });
  1869. export default AchievementDetail;