businessForm.jsx 24 KB

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