businessForm.jsx 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. import React from 'react';
  2. import $ from 'jquery/src/ajax';
  3. import {
  4. Icon,
  5. Tooltip,
  6. Modal,
  7. message,
  8. Spin,
  9. Upload,
  10. Input,
  11. Select,
  12. Button,
  13. Radio,
  14. Form,
  15. Cascader,
  16. Checkbox,
  17. Tag,
  18. Row,Col,
  19. InputNumber
  20. } from 'antd';
  21. import { citySelect } from '@/NewDicProvinceListAll';
  22. import { splitUrl ,getReleaseStateList} from '@/tools.js';
  23. import Editors from '@/richTextEditors';
  24. import './business.less';
  25. //图片组件
  26. const PicturesWall = React.createClass({
  27. getInitialState() {
  28. return {
  29. previewVisible: false,
  30. previewImage: '',
  31. fileList: []
  32. };
  33. },
  34. handleCancel() {
  35. this.setState({ previewVisible: false });
  36. },
  37. handlePreview(file) {
  38. this.setState({
  39. previewImage: file.url || file.thumbUrl,
  40. previewVisible: true
  41. });
  42. },
  43. handleChange(info) {
  44. let fileList = info.fileList;
  45. this.setState({ fileList });
  46. this.props.fileList(fileList);
  47. },
  48. componentWillReceiveProps(nextProps) {
  49. this.state.fileList = nextProps.pictureUrl;
  50. },
  51. render() {
  52. const { previewVisible, previewImage, fileList } = this.state;
  53. const uploadButton = (
  54. <div>
  55. <Icon type="plus" />
  56. <div className="ant-upload-text">点击上传</div>
  57. </div>
  58. );
  59. return (
  60. <div style={{ display: 'inline-block' }}>
  61. <Upload
  62. action={globalConfig.context + '/api/user/jtBusiness/project/uploadPicture'}
  63. data={{ sign: 'jt_project_picture' }}
  64. listType="picture-card"
  65. fileList={fileList}
  66. onPreview={this.handlePreview}
  67. onChange={this.handleChange}
  68. >
  69. {fileList.length >= 1 ? null : uploadButton}
  70. </Upload>
  71. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  72. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  73. </Modal>
  74. </div>
  75. );
  76. }
  77. });
  78. const DemandDetailForm = Form.create()(
  79. React.createClass({
  80. getInitialState() {
  81. return {
  82. tagArr:[],
  83. visible: false,
  84. loading: false,
  85. auditStatus: 0,
  86. textFileList: [],
  87. videoFileList: [],
  88. pictureUrl: [],
  89. orgCodeUrl: [],
  90. companyLogoUrl: [],
  91. tags: [],
  92. introduce:{},
  93. };
  94. },
  95. //左侧图片地址
  96. getOrgCodeUrl(e) {
  97. this.setState({ orgCodeUrl: e });
  98. },
  99. //右侧图片地址
  100. getCompanyLogoUrl(e) {
  101. this.setState({ companyLogoUrl: e });
  102. },
  103. //编辑部门,保存
  104. handleSubmit(e,index) {
  105. e.preventDefault();
  106. if (!this.state.name) {
  107. message.warning('请输入项目名称');
  108. return;
  109. }
  110. if ((this.state.name).length>50) {
  111. message.warning('项目名称在50个字以内');
  112. return false;
  113. };
  114. if (!this.state.categoryId||!this.state.categoryId[1]) {
  115. message.warning('请选择项目二级业务品类');
  116. return;
  117. }
  118. if (!this.state.ProvinceCity.length) {
  119. message.warning('请选择省份');
  120. return;
  121. }
  122. if (!this.state.price) {
  123. message.warning('请输入正确的市场价');
  124. return;
  125. }
  126. if (!this.state.keyword) {
  127. message.warning('请输入关键字');
  128. return;
  129. }
  130. if(this.state.summary&&(this.state.summary).length>40){
  131. message.warning('项目营销说明字数不得超过40个字。');
  132. return;
  133. }
  134. if(this.state.advertisement&&(this.state.advertisement).length>30){
  135. message.warning('项目营销说明字数不得超过30个字。');
  136. return;
  137. }
  138. if(this.state.introduce&&(this.state.introduce.length)>10000){
  139. message.warning('业务项目服务内容不大于10000字')
  140. return;
  141. }
  142. this.setState({
  143. loading: true
  144. });
  145. let minPictureUrl = [];
  146. if (this.state.orgCodeUrl.length) {
  147. let picArr = [];
  148. this.state.orgCodeUrl.map(function(item) {
  149. if (item.response && item.response.data && item.response.data.length) {
  150. picArr.push(item.response.data);
  151. }
  152. });
  153. minPictureUrl = picArr.join(',');
  154. }
  155. let maxPictureUrl = [];
  156. if (this.state.companyLogoUrl.length) {
  157. let picArr = [];
  158. this.state.companyLogoUrl.map(function(item) {
  159. if (item.response && item.response.data && item.response.data.length) {
  160. picArr.push(item.response.data);
  161. }
  162. });
  163. maxPictureUrl = picArr.join(',');
  164. }
  165. $.ajax({
  166. method: 'post',
  167. dataType: 'json',
  168. crossDomain: false,
  169. url: globalConfig.context + '/api/user/jtBusiness/project/update',
  170. data: {
  171. auditStatus:index,
  172. id: this.state.id, //业务名称
  173. name: this.state.name, //业务名称
  174. keyword:this.state.keyword, //关键字
  175. categoryId: this.state.categoryId[1], //业务品类
  176. price: this.state.price, //市场价
  177. advertisement:this.state.advertisement,//项目营销说明
  178. summary:this.state.summary,//项目简介
  179. activityPrice: this.state.activityPrice ? this.state.activityPrice : '0', //最低折扣
  180. memberPrice: this.state.memberPrice ? this.state.memberPrice : '0', //会员价
  181. offset: this.state.offset ? this.state.offset : '0',
  182. activityFlag: this.state.activityFlag, //活动生效标识
  183. province: this.state.ProvinceCity ? this.state.ProvinceCity[0] : '', //是否全国
  184. city: this.state.ProvinceCity ? this.state.ProvinceCity[1] : '',
  185. introduce: this.state.introduce,
  186. value: this.state.value,
  187. isHot: this.state.isHot,
  188. minImgUrl: minPictureUrl.length ? minPictureUrl : '',
  189. maxImgUrl: maxPictureUrl.length ? maxPictureUrl : '',
  190. applyConditions: this.state.applyConditions,
  191. tag:this.state.tagArr.join(',')
  192. }
  193. }).done(
  194. function(data) {
  195. if (!data.error.length) {
  196. this.setState({
  197. loading: false,
  198. editvisible: false
  199. });
  200. if(index){
  201. this.submission();
  202. }else{
  203. message.success('保存成功!');
  204. }
  205. } else {
  206. message.warning(data.error[0].message);
  207. }
  208. this.props.handOk();
  209. }.bind(this)
  210. );
  211. },
  212. loadData(ids) {
  213. $.ajax({
  214. method: 'get',
  215. dataType: 'json',
  216. crossDomain: false,
  217. url: globalConfig.context + '/api/user/jtBusiness/project/detail',
  218. data: {
  219. id: ids
  220. },
  221. success: function(data) {
  222. if (!data.data) {
  223. if (data.error && data.error.length) {
  224. message.warning(data.error[0].message);
  225. }
  226. } else {
  227. let categoryIdArr=[];
  228. let thisdata = data.data;
  229. let ProvinceCityArr = [];
  230. ProvinceCityArr.push(thisdata.province, thisdata.city);
  231. (this.props.categoryList).map(item=>{
  232. if(item.children.length){
  233. (item.children).map(atem=>{
  234. if(atem.value==thisdata.categoryId){
  235. categoryIdArr.push(item.value,atem.value)
  236. }
  237. })
  238. }
  239. })
  240. let tagFirst =thisdata.tags,tagTxt=[],tagArr=[];
  241. tagFirst.map(item=>{
  242. tagTxt.push(item.name);
  243. tagArr.push(item.id)
  244. })
  245. this.setState({
  246. id: thisdata.id, //业务名称
  247. name: thisdata.name, //业务名称
  248. keyword:this.state.keyword, //关键字
  249. tagTxt:tagTxt.join(' - '),
  250. tagArr:tagArr,
  251. categoryId: categoryIdArr, //业务品类
  252. number: thisdata.number,
  253. auditInfo:thisdata.auditInfo,
  254. price: thisdata.price, //市场价
  255. advertisement:thisdata.advertisement,//项目营销说明
  256. summary:thisdata.summary,//项目简介
  257. activityPrice: thisdata.activityPrice ? thisdata.activityPrice : '', //最低折扣
  258. memberPrice: thisdata.memberPrice ? thisdata.memberPrice : '', //会员价
  259. offset: thisdata.offset ? thisdata.offset : '',
  260. activityFlag: thisdata.activityFlag ? thisdata.activityFlag.toString() : '', //活动生效标识
  261. ProvinceCity: ProvinceCityArr,
  262. introduce: thisdata.introduce,
  263. createTime: thisdata.createTime ? new Date(thisdata.createTime).toLocaleString() : '',
  264. value: thisdata.value,
  265. isHot:thisdata.isHot,
  266. auditStatus:thisdata.auditStatus,
  267. applyConditions: thisdata.applyConditions,
  268. orgCodeUrl: thisdata.minImgUrl
  269. ? splitUrl(thisdata.minImgUrl, ',', globalConfig.avatarHost + '/upload')
  270. : [],
  271. companyLogoUrl: thisdata.maxImgUrl
  272. ? splitUrl(thisdata.maxImgUrl, ',', globalConfig.avatarHost + '/upload')
  273. : []
  274. });
  275. }
  276. }.bind(this)
  277. }).always(
  278. function() {
  279. this.setState({
  280. loading: false
  281. });
  282. }.bind(this)
  283. );
  284. },
  285. submission(e) {
  286. $.ajax({
  287. method: 'get',
  288. dataType: 'json',
  289. crossDomain: false,
  290. async: true,
  291. url: globalConfig.context + '/api/user/jtBusiness/project/publish',
  292. data: {
  293. id: this.state.id,
  294. auditStatus:1
  295. }
  296. }).done(
  297. function(data) {
  298. if (!data.error.length) {
  299. message.success('提交成功,请耐心等待审核结果.')
  300. this.setState({
  301. loading: false
  302. });
  303. } else {
  304. message.warning(data.error[0].message);
  305. }
  306. }.bind(this)
  307. );
  308. },
  309. cancelFun() {
  310. this.props.closeDesc();
  311. },
  312. componentWillMount() {
  313. if (this.props.data.id) {
  314. this.state.introduce='<p><br></p>';
  315. this.loadData(this.props.data.id);
  316. }
  317. },
  318. //标签
  319. tagOk(){
  320. this.setState({
  321. visibleTag:false
  322. })
  323. },
  324. tagCancel(){
  325. this.setState({
  326. visibleTag:false
  327. })
  328. },
  329. selTag(){
  330. this.setState({
  331. visibleTag:true
  332. })
  333. this.state.tagArr=this.state.tagArr;
  334. },
  335. onChange(e){
  336. this.setState({
  337. tagArr:e
  338. })
  339. },
  340. tagSubmit(e){
  341. e.preventDefault();
  342. let tags =[];
  343. (this.props.tagList).map(item=>{
  344. for(let i=0;i<(this.state.tagArr).length;i++){
  345. if(item.id==(this.state.tagArr[i])){
  346. tags.push(item.name)
  347. }
  348. }
  349. })
  350. this.tagCancel();
  351. this.setState({
  352. tagTxt:tags.join(' - ')
  353. })
  354. },
  355. //发布后查看效果
  356. lookSee(e){
  357. e.preventDefault();
  358. if (!this.state.name) {
  359. message.warning('请输入项目名称');
  360. return;
  361. }
  362. if ((this.state.name).length>16) {
  363. message.warning('项目名称在16个字以内');
  364. return false;
  365. };
  366. if (!this.state.categoryId||!this.state.categoryId[1]) {
  367. message.warning('请选择项目二级业务品类');
  368. return;
  369. }
  370. if (!this.state.ProvinceCity.length) {
  371. message.warning('请选择省份');
  372. return;
  373. }
  374. if (!this.state.price) {
  375. message.warning('请输入正确的市场价');
  376. return;
  377. }
  378. if(this.state.summary&&(this.state.summary).length>40){
  379. message.warning('项目营销说明字数不得超过40个字。');
  380. return;
  381. }
  382. if(this.state.advertisement&&(this.state.advertisement).length>30){
  383. message.warning('项目营销说明字数不得超过30个字.');
  384. return;
  385. }
  386. this.setState({
  387. loading: true
  388. });
  389. let minPictureUrl = [];
  390. if (this.state.orgCodeUrl.length) {
  391. let picArr = [];
  392. this.state.orgCodeUrl.map(function(item) {
  393. if (item.response && item.response.data && item.response.data.length) {
  394. picArr.push(item.response.data);
  395. }
  396. });
  397. minPictureUrl = picArr.join(',');
  398. }
  399. let maxPictureUrl = [];
  400. if (this.state.companyLogoUrl.length) {
  401. let picArr = [];
  402. this.state.companyLogoUrl.map(function(item) {
  403. if (item.response && item.response.data && item.response.data.length) {
  404. picArr.push(item.response.data);
  405. }
  406. });
  407. maxPictureUrl = picArr.join(',');
  408. }
  409. $.ajax({
  410. method: 'post',
  411. dataType: 'json',
  412. crossDomain: false,
  413. url: globalConfig.context + '/api/user/jtBusiness/project/update',
  414. data: {
  415. id: this.state.id, //业务名称
  416. name: this.state.name, //业务名称
  417. keyword:this.state.keyword, //关键字
  418. categoryId: this.state.categoryId[1], //业务品类
  419. price: this.state.price, //市场价
  420. advertisement:this.state.advertisement,//项目营销说明
  421. summary:this.state.summary,//项目简介
  422. activityPrice: this.state.activityPrice ? this.state.activityPrice : '0', //最低折扣
  423. memberPrice: this.state.memberPrice ? this.state.memberPrice : '0', //会员价
  424. offset: this.state.offset ? this.state.offset : '0',
  425. activityFlag: this.state.activityFlag, //活动生效标识
  426. province: this.state.ProvinceCity ? this.state.ProvinceCity[0] : '', //是否全国
  427. city: this.state.ProvinceCity ? this.state.ProvinceCity[1] : '',
  428. introduce: this.state.introduce,
  429. value: this.state.value,
  430. isHot: this.state.isHot,
  431. minImgUrl: minPictureUrl.length ? minPictureUrl : '',
  432. maxImgUrl: maxPictureUrl.length ? maxPictureUrl : '',
  433. applyConditions: this.state.applyConditions,
  434. tag:this.state.tagArr.join(',')
  435. }
  436. }).done(
  437. function(data) {
  438. if (!data.error.length) {
  439. this.setState({
  440. loading: false,
  441. });
  442. message.success('提交预览请求成功,即将跳转预览页面');
  443. setTimeout(()=>{
  444. window.open(globalConfig.context+'/portal/service/patentDetail?id='+this.state.id)
  445. },1000)
  446. } else {
  447. message.warning(data.error[0].message);
  448. }
  449. }.bind(this)
  450. );
  451. },
  452. componentWillReceiveProps(nextProps) {
  453. if (!this.props.visible && nextProps.visible) {
  454. this.state.textFileList = [];
  455. this.state.videoFileList = [];
  456. if (nextProps.data.id) {
  457. this.state.introduce='<p><br></p>';
  458. this.loadData(nextProps.data.id);
  459. }
  460. }
  461. },
  462. render() {
  463. const FormItem = Form.Item;
  464. const formItemLayout = {
  465. labelCol: { span: 6 },
  466. wrapperCol: { span: 16 },
  467. };
  468. let categoryList = this.props.categoryList||[];
  469. let plainOptions= this.props.tagList||[];
  470. return (
  471. <div className="patent-desc">
  472. <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} id="demand-form">
  473. <Spin spinning={this.state.loading}>
  474. <div className="clearfix" style={{ paddingLeft: '86px' }}>
  475. <FormItem
  476. className="half-item"
  477. labelCol={{ span: 4 }}
  478. wrapperCol={{ span: 12 }}
  479. label={
  480. <span>
  481. <strong style={{ color: 'red' }}>*</strong>项目名称
  482. </span>
  483. }
  484. >
  485. <Input
  486. placeholder="项目名称"
  487. value={this.state.name}
  488. onChange={(e) => {
  489. this.setState({ name: e.target.value });
  490. }}
  491. />
  492. </FormItem>
  493. <FormItem
  494. className="half-item"
  495. labelCol={{ span: 4 }}
  496. wrapperCol={{ span: 12 }}
  497. label={
  498. <span>
  499. <strong style={{ color: 'red' }}>*</strong>业务品类
  500. </span>
  501. }
  502. >
  503. <Cascader
  504. options={categoryList}
  505. value={this.state.categoryId}
  506. placeholder="业务品类"
  507. onChange={(e, pre) => {
  508. this.setState({ categoryId: e });
  509. }}
  510. />
  511. </FormItem>
  512. </div>
  513. <div className="clearfix" style={{ paddingLeft: '86px' }}>
  514. <FormItem
  515. className="half-item"
  516. labelCol={{ span: 4 }}
  517. wrapperCol={{ span: 12 }}
  518. label={
  519. <span>
  520. <strong style={{ color: 'red' }}>*</strong>省-市
  521. </span>
  522. }
  523. >
  524. <Cascader
  525. options={citySelect()}
  526. value={this.state.ProvinceCity}
  527. placeholder="选择市"
  528. onChange={(e, pre) => {
  529. this.setState({ ProvinceCity: e });
  530. }}
  531. />
  532. </FormItem>
  533. <FormItem
  534. className="half-item"
  535. labelCol={{ span: 4 }}
  536. wrapperCol={{ span: 12 }}
  537. label={
  538. <span>
  539. <strong style={{ color: 'red' }}>*</strong>热点
  540. </span>
  541. }
  542. >
  543. <Radio.Group
  544. onChange={(e) => {
  545. this.setState({ isHot: e.target.value });
  546. }}
  547. value={this.state.isHot}
  548. >
  549. <Radio value={0}>否</Radio>
  550. <Radio value={1}>是</Radio>
  551. </Radio.Group>
  552. </FormItem>
  553. </div>
  554. <div className="clearfix" style={{ paddingLeft: '86px' }}>
  555. <FormItem
  556. className="half-item"
  557. labelCol={{ span: 4 }}
  558. wrapperCol={{ span: 12 }}
  559. label={
  560. <span>
  561. <strong style={{ color: 'red' }}>*</strong>市场价
  562. </span>
  563. }
  564. >
  565. <InputNumber
  566. placeholder="市场价"
  567. value={this.state.price}
  568. style={{ width: 120 }}
  569. onChange={(e) => {
  570. this.setState({ price: e });
  571. }}
  572. required="required"
  573. />
  574. <span style={{ marginLeft: 10 }}>万元</span>
  575. </FormItem>
  576. <FormItem
  577. className="half-item"
  578. labelCol={{ span: 4 }}
  579. wrapperCol={{ span: 12 }}
  580. label="活动价"
  581. >
  582. <InputNumber
  583. placeholder="活动价"
  584. value={this.state.activityPrice}
  585. style={{ width: 120 }}
  586. onChange={(e) => {
  587. this.setState({ activityPrice: e });
  588. }}
  589. min={0}
  590. max={999999}
  591. step={0.01}
  592. />
  593. <span style={{ marginLeft: 10 }}>万元</span>
  594. </FormItem>
  595. <FormItem
  596. className="half-item"
  597. labelCol={{ span: 4 }}
  598. wrapperCol={{ span: 12 }}
  599. label="最低折扣"
  600. >
  601. <InputNumber
  602. placeholder="最低折扣(如:0.5)"
  603. value={this.state.offset}
  604. style={{ width: '50%' }}
  605. onChange={(e) => {
  606. this.setState({ offset: e });
  607. }}
  608. min={0}
  609. max={1}
  610. step={0.01}
  611. />
  612. </FormItem>
  613. <FormItem
  614. className="half-item"
  615. labelCol={{ span: 4 }}
  616. wrapperCol={{ span: 12 }}
  617. label="会员价"
  618. >
  619. <InputNumber
  620. placeholder="会员价"
  621. value={this.state.memberPrice}
  622. style={{ width: '120px' }}
  623. onChange={(e) => {
  624. this.setState({ memberPrice: e });
  625. }}
  626. min={0}
  627. max={999999}
  628. step={0.01}
  629. />
  630. <span style={{ marginLeft: 10 }}>万元</span>
  631. </FormItem>
  632. <FormItem
  633. className="half-item"
  634. labelCol={{ span: 4 }}
  635. wrapperCol={{ span: 12 }}
  636. label="活动生效"
  637. >
  638. <Select
  639. placeholder="活动生效"
  640. value={this.state.activityFlag}
  641. style={{ width: '94%' }}
  642. onChange={(e) => {
  643. this.setState({ activityFlag: e });
  644. }}
  645. >
  646. <Select.Option key="0">无效</Select.Option>
  647. <Select.Option key="1">有效</Select.Option>
  648. </Select>
  649. </FormItem>
  650. <FormItem
  651. className="half-item"
  652. labelCol={{ span: 4 }}
  653. wrapperCol={{ span: 12 }}
  654. label={
  655. <span>
  656. <strong style={{ color: 'red' }}>*</strong>关键字
  657. </span>
  658. }
  659. >
  660. <Input
  661. placeholder="请填写关键字"
  662. value={this.state.keyword}
  663. onChange={(e) => {
  664. this.setState({ keyword: e.target.value });
  665. }}
  666. />
  667. </FormItem>
  668. <FormItem
  669. className="half-item"
  670. labelCol={{ span: 4 }}
  671. wrapperCol={{ span: 12 }}
  672. label="创建时间"
  673. >
  674. <span style={{ width: '94%' }}>{this.state.createTime}</span>
  675. </FormItem>
  676. </div>
  677. <div className="clearfix">
  678. <FormItem
  679. labelCol={{ span: 4 }}
  680. wrapperCol={{ span: 12 }}
  681. label="标签">
  682. <div>
  683. <span style={{marginRight:10}}>{this.state.tagTxt}</span>
  684. <Button onClick={this.selTag}>选择</Button>
  685. </div>
  686. </FormItem>
  687. </div>
  688. <div>
  689. <FormItem
  690. labelCol={{ span: 4 }}
  691. wrapperCol={{ span: 12 }}
  692. label="发布状态">
  693. <span>{getReleaseStateList(this.state.auditStatus)}</span>
  694. </FormItem>
  695. </div>
  696. <div className="clearfix">
  697. {this.state.auditInfo?<FormItem
  698. labelCol={{ span: 4 }}
  699. wrapperCol={{ span: 12 }}
  700. label="拒绝原因">
  701. <span>{this.state.auditInfo}</span>
  702. </FormItem>:''}
  703. </div>
  704. <div className="clearfix">
  705. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 12 }} label="项目简介">
  706. <Input
  707. type="textarea"
  708. rows={4}
  709. placeholder="请输入项目简介"
  710. value={this.state.summary}
  711. onChange={(e) => {
  712. this.setState({ summary: e.target.value });
  713. }}
  714. />
  715. </FormItem>
  716. </div>
  717. <div className="clearfix">
  718. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 12 }} label="项目营销说明">
  719. <Input
  720. type="textarea"
  721. rows={4}
  722. placeholder="项目营销说明"
  723. value={this.state.advertisement}
  724. onChange={(e) => {
  725. this.setState({ advertisement: e.target.value });
  726. }}
  727. />
  728. </FormItem>
  729. </div>
  730. {/*<div className="clearfix">
  731. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 12 }} label="业务项目价值及作用">
  732. <Input
  733. type="textarea"
  734. rows={4}
  735. placeholder="业务项目价值及作用"
  736. value={this.state.value}
  737. onChange={(e) => {
  738. this.setState({ value: e.target.value });
  739. }}
  740. />
  741. </FormItem>
  742. </div>
  743. <div className="clearfix">
  744. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 12 }} label="业务项目客户基本条件">
  745. <Input
  746. type="textarea"
  747. rows={4}
  748. placeholder="业务项目客户基本条件"
  749. value={this.state.applyConditions}
  750. onChange={(e) => {
  751. this.setState({ applyConditions: e.target.value });
  752. }}
  753. />
  754. </FormItem>
  755. </div>*/}
  756. <div className="clearfix">
  757. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label='业务项目服务内容'>
  758. <Editors textContent={this.state.introduce} placeholder="业务项目客户基本条件"
  759. uploadUrl={'/api/user/demand/uploadPicture'}
  760. uploadSign={'demand_picture'}
  761. handleRichText={(value) => { this.state.introduce = value; }}
  762. visible={this.state.visible} />
  763. <Button type="dashed" onClick={this.lookSee} style={{marginTop:10}}>预览发布后效果</Button>
  764. </FormItem>
  765. </div>
  766. <div className="clearfix pictures">
  767. <FormItem
  768. className="half-item"
  769. labelCol={{ span: 8 }}
  770. wrapperCol={{ span: 10 }}
  771. label="业务项目图标(小)"
  772. >
  773. <PicturesWall
  774. pictureSign="business_project_min_picture"
  775. fileList={this.getOrgCodeUrl}
  776. pictureUrl={this.state.orgCodeUrl}
  777. />
  778. <p>图片建议:图片要清晰。(72*72)</p>
  779. </FormItem>
  780. <FormItem
  781. className="half-item"
  782. labelCol={{ span: 8 }}
  783. wrapperCol={{ span: 12 }}
  784. label="业务项目图标(大)"
  785. >
  786. <PicturesWall
  787. pictureSign="business_project_max_picture"
  788. fileList={this.getCompanyLogoUrl}
  789. pictureUrl={this.state.companyLogoUrl}
  790. />
  791. <p>图片建议:图片要清晰。(330*230)</p>
  792. </FormItem>
  793. </div>
  794. <Button
  795. className="set-submit"
  796. type="primary"
  797. htmlType="submit"
  798. style={{ marginLeft: '160px', marginBottom: '20px', marginTop: '20px' }}
  799. >
  800. 保存
  801. </Button>
  802. <Button
  803. className="set-submit"
  804. type="ghost"
  805. onClick={(e) => {
  806. this.handleSubmit(e,1)
  807. }}
  808. >
  809. 提交审核
  810. </Button>
  811. <Button
  812. className="set-submit"
  813. type="ghost"
  814. onClick={this.cancelFun}
  815. >
  816. 取消
  817. </Button>
  818. </Spin>
  819. </Form>
  820. <Modal
  821. maskClosable={false}
  822. visible={this.state.visibleTag}
  823. onOk={this.tagOk}
  824. onCancel={this.tagCancel}
  825. width="450px"
  826. title="新建标签"
  827. footer=""
  828. >
  829. <Form layout="horizontal" onSubmit={(e)=>{this.tagSubmit(e)}} id="demand-form">
  830. <Form.Item {...formItemLayout} label={<span><strong style={{color:'#f00'}}> * </strong>标签</span>}>
  831. <Checkbox.Group
  832. value={this.state.tagArr}
  833. onChange={this.onChange}>
  834. <Row>
  835. {plainOptions.map((item)=>{
  836. return <Col span={8} key={item.id} ><Checkbox value={item.id}>{item.name}</Checkbox></Col>
  837. })}
  838. </Row>
  839. </Checkbox.Group>
  840. </Form.Item>
  841. <div className="clearfix">
  842. <Form.Item wrapperCol={{ span: 12, offset: 6 }}>
  843. <Button className="set-submit" type="primary" htmlType="submit">
  844. 选定
  845. </Button>
  846. <Button className="set-submit" type="ghost" onClick={this.tagCancel}>
  847. 取消
  848. </Button>
  849. </Form.Item>
  850. </div>
  851. </Form>
  852. </Modal>
  853. </div>
  854. );
  855. }
  856. })
  857. );
  858. export default DemandDetailForm;