businessProject.jsx 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. import React from 'react';
  2. import $ from 'jquery/src/ajax';
  3. import { citySelect} from '@/NewDicProvinceListAll';
  4. import { Form, Icon, Button, Input, Select, Spin, Table, message, DatePicker, Modal, Upload,Popconfirm,Cascader, InputNumber } from 'antd';
  5. import {getGameState,splitUrl,getprovince} from '@/tools.js';
  6. //图片组件
  7. const PicturesWall = React.createClass({
  8. getInitialState() {
  9. return {
  10. previewVisible: false,
  11. previewImage: '',
  12. fileList: [],
  13. }
  14. },
  15. handleCancel() {
  16. this.setState({ previewVisible: false })
  17. },
  18. handlePreview(file) {
  19. this.setState({
  20. previewImage: file.url || file.thumbUrl,
  21. previewVisible: true,
  22. });
  23. },
  24. handleChange(info) {
  25. let fileList = info.fileList;
  26. this.setState({ fileList });
  27. this.props.fileList(fileList);
  28. },
  29. componentWillReceiveProps(nextProps) {
  30. this.state.fileList = nextProps.pictureUrl;
  31. },
  32. render() {
  33. const { previewVisible, previewImage, fileList } = this.state;
  34. const uploadButton = (
  35. <div>
  36. <Icon type="plus" />
  37. <div className="ant-upload-text">点击上传</div>
  38. </div>
  39. );
  40. return (
  41. <div style={{display:"inline-block"}}>
  42. <Upload
  43. action={globalConfig.context + "/api/user/jtBusiness/project/uploadPicture"}
  44. data={{ 'sign': 'jt_project_picture' }}
  45. listType="picture-card"
  46. fileList={fileList}
  47. onPreview={this.handlePreview}
  48. onChange={this.handleChange} >
  49. {fileList.length >= 1 ? null : uploadButton}
  50. </Upload>
  51. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  52. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  53. </Modal>
  54. </div>
  55. );
  56. }
  57. });
  58. //主体
  59. const BusinessProject=Form.create()(React.createClass({
  60. loadData(pageNo) {
  61. this.state.data = [];
  62. this.setState({
  63. loading: true,
  64. page:pageNo,
  65. });
  66. $.ajax({
  67. method: "get",
  68. dataType: "json",
  69. crossDomain: false,
  70. url: globalConfig.context + '/portal/service/jtProject/list',
  71. data: {
  72. pageNo: pageNo || 1,
  73. pageSize: this.state.pagination.pageSize,
  74. secondId:this.state.cid,
  75. name:this.state.nameSearch,
  76. },
  77. success: function (data) {
  78. let theArr = [];
  79. if (!data.data || !data.data.list) {
  80. if (data.error && data.error.length) {
  81. message.warning(data.error[0].message);
  82. };
  83. } else {
  84. for (let i = 0; i < data.data.list.length; i++) {
  85. let thisdata = data.data.list[i],
  86. ProvinceCityArr = [],
  87. cname='',superName='',
  88. ProvinceS = thisdata.province, //getprovince
  89. citys = thisdata.city,
  90. Areas = thisdata.area;
  91. ProvinceCityArr.push(ProvinceS, citys, Areas);
  92. this.state.categoryList.map(item=>{
  93. if(thisdata.categoryId==item.id){
  94. cname=item.name;
  95. superName=item.superName
  96. }
  97. })
  98. theArr.push({
  99. key: i,
  100. id:thisdata.id,//业务名称
  101. name: thisdata.name,//业务名称
  102. categoryId: thisdata.categoryId,//业务品类
  103. number:thisdata.number,
  104. price: thisdata.price,//市场价
  105. superName:superName,
  106. cname:cname,
  107. city:thisdata.city,
  108. activityPrice:thisdata.activityPrice?thisdata.activityPrice:'',//最低折扣
  109. memberPrice:thisdata.memberPrice?thisdata.memberPrice:'',//会员价
  110. offset:thisdata.offset?thisdata.offset:'',
  111. activityPrice:thisdata.activityPrice?thisdata.activityPrice:'',//活动价
  112. activityFlag:thisdata.activityFlag,//活动生效标识
  113. status: thisdata.status,//项目状态
  114. province:thisdata.province,
  115. introduce:thisdata.introduce,
  116. createTime:thisdata.createTime?(new Date(thisdata.createTime)).toLocaleString():'',
  117. value:thisdata.value,
  118. applyConditions:thisdata.applyConditions
  119. });
  120. };
  121. this.state.pagination.current = data.data.pageNo;
  122. this.state.pagination.total = data.data.totalCount;
  123. };
  124. this.setState({
  125. dataSource: theArr,
  126. pagination: this.state.pagination
  127. });
  128. }.bind(this),
  129. }).always(function () {
  130. this.setState({
  131. loading: false
  132. });
  133. }.bind(this));
  134. },
  135. getInitialState() {
  136. return {
  137. searchMore: true,
  138. selectedRowKeys: [],
  139. selectedRows: [],
  140. loading: false,
  141. orgCodeUrl: [],
  142. companyLogoUrl: [],
  143. pagination: {
  144. defaultCurrent: 1,
  145. defaultPageSize: 10,
  146. showQuickJumper: true,
  147. pageSize: 10,
  148. onChange: function (page) {
  149. this.loadData(page);
  150. this.setState({
  151. selectedRowKeys: [],
  152. })
  153. }.bind(this),
  154. showTotal: function (total) {
  155. return '共' + total + '条数据';
  156. }
  157. },
  158. formatPagination: {
  159. defaultCurrent: 1,
  160. defaultPageSize: 10,
  161. showQuickJumper: true,
  162. pageSize: 10,
  163. onChange: function (page) {
  164. this.loadData(page);
  165. }.bind(this),
  166. showTotal: function (total) {
  167. return '共' + total + '条数据';
  168. }
  169. },
  170. formatDataSource: [],
  171. columns: [
  172. {
  173. title: '项目名称',
  174. dataIndex: 'name',
  175. key: 'bname',
  176. }, {
  177. title: '品类名称',
  178. dataIndex: 'cname',
  179. key: 'cname'
  180. },
  181. {
  182. title: '上级品类',
  183. dataIndex: 'superName',
  184. key: 'superName'
  185. }, {
  186. title: '业务地区',
  187. dataIndex: 'area',
  188. key: 'area',
  189. render: (text,rocard) => { return <div>{rocard.province!=0?<span>{getprovince(rocard.province)+'-'+getprovince(rocard.city)}</span>:'全国'}</div> }
  190. },
  191. {
  192. title: '市场价',
  193. dataIndex: 'price',
  194. key: 'price',
  195. }, {
  196. title: '最低折扣',
  197. dataIndex: 'offset',
  198. key: 'offset',
  199. }, {
  200. title: '会员价',
  201. dataIndex: 'memberPrice',
  202. key: 'memberPrice',
  203. }, {
  204. title: '活动价',
  205. dataIndex: 'activityPrice',
  206. key: 'activityPrice',
  207. }, {
  208. title: '活动生效标识',
  209. dataIndex: 'activityFlag',
  210. key: 'activityFlag',
  211. render: text => { return getGameState(text) }
  212. }
  213. ],
  214. dataSource: [],
  215. };
  216. },
  217. //业务品类列表获取
  218. topLevel(){
  219. $.ajax({
  220. method: "get",
  221. dataType: "json",
  222. crossDomain: false,
  223. url: globalConfig.context + '/api/user/jtBusiness/category/list',
  224. data: {
  225. pageNo: 1,
  226. pageSize: 999,
  227. },
  228. success: function (data) {
  229. let theArr = [],firstData=[];
  230. if (!data.data || !data.data.list) {
  231. if (data.error && data.error.length) {
  232. message.warning(data.error[0].message);
  233. };
  234. } else {
  235. for (let i = 0; i < data.data.list.length; i++) {
  236. let thisdata = data.data.list[i];
  237. theArr.push({
  238. key: i,
  239. id:thisdata.id,
  240. name: thisdata.name,
  241. superName:thisdata.superName//上级品类
  242. });
  243. if(thisdata.layer=='2'){
  244. firstData.push({
  245. key: i,
  246. id:thisdata.id,
  247. name: thisdata.name,
  248. superName:thisdata.superName//上级品类
  249. })
  250. }
  251. };
  252. };
  253. this.setState({
  254. categoryList: theArr,
  255. firstData:firstData
  256. });
  257. this.loadData();
  258. }.bind(this),
  259. }).always(function () {
  260. this.setState({
  261. loading: false
  262. });
  263. }.bind(this));
  264. },
  265. componentWillMount() {
  266. this.topLevel()
  267. },
  268. //编辑部门,保存
  269. edithandleSubmit(e){
  270. e.preventDefault();
  271. if(!this.state.name){
  272. message.warning('请输入项目名称');
  273. return ;
  274. }
  275. if(!this.state.categoryId){
  276. message.warning('请选择项目业务品类');
  277. return ;
  278. }
  279. if(!(this.state.ProvinceCity.length)){
  280. message.warning('请选择省份');
  281. return ;
  282. }
  283. if(!(this.state.price)){
  284. message.warning('请输入正确的市场价');
  285. return ;
  286. }
  287. this.setState({
  288. loading:true
  289. })
  290. let minPictureUrl = [];
  291. if (this.state.orgCodeUrl.length) {
  292. let picArr = [];
  293. this.state.orgCodeUrl.map(function (item) {
  294. if ( item.response && item.response.data && item.response.data.length ){
  295. picArr.push(item.response.data);
  296. }
  297. });
  298. minPictureUrl = picArr.join(",");
  299. };
  300. let maxPictureUrl = [];
  301. if (this.state.companyLogoUrl.length) {
  302. let picArr = [];
  303. this.state.companyLogoUrl.map(function (item) {
  304. if ( item.response && item.response.data && item.response.data.length ){
  305. picArr.push(item.response.data);
  306. }
  307. });
  308. maxPictureUrl = picArr.join(",");
  309. };
  310. $.ajax({
  311. method: "post",
  312. dataType: "json",
  313. crossDomain: false,
  314. url: globalConfig.context + "/api/user/jtBusiness/project/update",
  315. data: {
  316. id:this.state.id,//业务名称
  317. name: this.state.name,//业务名称
  318. categoryId: this.state.categoryId,//业务品类
  319. price: this.state.price,//市场价
  320. activityPrice:this.state.activityPrice?this.state.activityPrice:'0',//最低折扣
  321. memberPrice:this.state.memberPrice?this.state.memberPrice:'0',//会员价
  322. offset:this.state.offset?this.state.offset:'0',
  323. activityFlag:this.state.activityFlag,//活动生效标识
  324. province:this.state.ProvinceCity?this.state.ProvinceCity[0]:'',//是否全国
  325. city:this.state.ProvinceCity?this.state.ProvinceCity[1]:'',
  326. introduce:this.state.introduce,
  327. value:this.state.value,
  328. minImgUrl:minPictureUrl.length?minPictureUrl:'',
  329. maxImgUrl:maxPictureUrl.length?maxPictureUrl:'',
  330. applyConditions:this.state.applyConditions,
  331. }
  332. }).done(function (data) {
  333. if (!data.error.length) {
  334. message.success('保存成功!');
  335. this.setState({
  336. loading: false,
  337. editvisible:false
  338. });
  339. } else {
  340. message.warning(data.error[0].message);
  341. };
  342. this.loadData(this.state.page)
  343. }.bind(this));
  344. },
  345. detailes(recard){
  346. $.ajax({
  347. method: "get",
  348. dataType: "json",
  349. crossDomain: false,
  350. url: globalConfig.context + '/api/user/jtBusiness/project/detail',
  351. data: {
  352. id:recard.id
  353. },
  354. success: function (data) {
  355. if (!data.data) {
  356. if (data.error && data.error.length) {
  357. message.warning(data.error[0].message);
  358. };
  359. } else {
  360. let thisdata=data.data;
  361. let ProvinceCityArr=[];
  362. ProvinceCityArr.push(thisdata.province,thisdata.city)
  363. this.setState({
  364. id:thisdata.id,//业务名称
  365. name: thisdata.name,//业务名称
  366. categoryId: thisdata.categoryId,//业务品类
  367. number:thisdata.number,
  368. price: thisdata.price,//市场价
  369. activityPrice:thisdata.activityPrice?thisdata.activityPrice:'',//最低折扣
  370. memberPrice:thisdata.memberPrice?thisdata.memberPrice:'',//会员价
  371. offset:thisdata.offset?thisdata.offset:'',
  372. activityFlag:thisdata.activityFlag?thisdata.activityFlag.toString():'',//活动生效标识
  373. ProvinceCity:ProvinceCityArr,
  374. introduce:thisdata.introduce,
  375. createTime:thisdata.createTime?(new Date(thisdata.createTime)).toLocaleString():'',
  376. value:thisdata.value,
  377. applyConditions:thisdata.applyConditions,
  378. orgCodeUrl: thisdata.minImgUrl ? splitUrl(thisdata.minImgUrl, ',', globalConfig.avatarHost + '/upload') : [],
  379. companyLogoUrl:thisdata.maxImgUrl ? splitUrl(thisdata.maxImgUrl, ',', globalConfig.avatarHost + '/upload') : [],
  380. })
  381. };
  382. }.bind(this),
  383. }).always(function () {
  384. this.setState({
  385. loading: false
  386. });
  387. }.bind(this));
  388. },
  389. //项目列表整行点击
  390. tableRowClick(record, index) {
  391. this.state.RowData = record;
  392. this.setState({
  393. editvisible:true
  394. })
  395. this.detailes(record)
  396. },
  397. //左侧图片地址
  398. getOrgCodeUrl(e) {
  399. this.setState({ orgCodeUrl: e });
  400. },
  401. //右侧图片地址
  402. getCompanyLogoUrl(e) {
  403. this.setState({ companyLogoUrl: e });
  404. },
  405. //新增一个项目,保存
  406. addhandleSubmit(e){
  407. e.preventDefault();
  408. if(!this.state.categoryName){
  409. message.warning('请输入项目名称');
  410. return false;
  411. }
  412. if(!this.state.addCid){
  413. message.warning('请选择项目品类');
  414. return false;
  415. }
  416. this.setState({
  417. loading: true
  418. });
  419. //上级组织字典
  420. $.ajax({
  421. method: "post",
  422. dataType: "json",
  423. crossDomain: false,
  424. url:globalConfig.context + '/api/user/jtBusiness/project/apply',
  425. data:{
  426. name:this.state.categoryName,//项目名称
  427. categoryId:this.state.addCid,
  428. province:this.state.ProvinceCity?this.state.ProvinceCity[0]:'',//是否全国
  429. city:this.state.ProvinceCity?this.state.ProvinceCity[1]:''
  430. }
  431. }).done(function (data) {
  432. this.setState({
  433. loading: false
  434. });
  435. if (!data.error.length) {
  436. message.success('新增项目成功!');
  437. this.handleCancel();
  438. this.loadData(this.state.page);
  439. } else {
  440. message.warning(data.error[0].message);
  441. }
  442. }.bind(this));
  443. },
  444. //项目整行删除
  445. delectRow() {
  446. let deletedIds = '';
  447. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  448. let rowItem = this.state.selectedRows[idx];
  449. if (rowItem.id) {
  450. deletedIds=rowItem.id;
  451. };
  452. };
  453. this.setState({
  454. selectedRowKeys: [],
  455. loading: deletedIds.length > 0
  456. });
  457. $.ajax({
  458. method: "get",
  459. dataType: "json",
  460. crossDomain: false,
  461. url: globalConfig.context + "/api/user/jtBusiness/project/delete",
  462. data: {
  463. id:deletedIds
  464. }
  465. }).done(function (data) {
  466. if (!data.error.length) {
  467. message.success('删除成功!');
  468. this.setState({
  469. loading: false,
  470. });
  471. } else {
  472. message.warning(data.error[0].message);
  473. };
  474. this.loadData(this.state.page);
  475. }.bind(this));
  476. },
  477. addClick() {
  478. this.state.RowData = {};
  479. this.setState({
  480. visible: true
  481. });
  482. this.addReset();
  483. },
  484. editClick(e) {
  485. this.state.RowData = {};
  486. this.setState({
  487. editvisible: true
  488. });
  489. },
  490. handleCancel() {
  491. this.setState({ visible: false })
  492. },
  493. edithandleCancel(e) {
  494. this.setState({
  495. editvisible: false
  496. });
  497. },
  498. search() {
  499. this.loadData();
  500. },
  501. //搜索部分的清零
  502. reset() {
  503. this.state.nameSearch = '';//项目名称清零
  504. this.state.cid = undefined;//品类名称清零
  505. this.state.ressSearch= undefined;//省市区清零
  506. this.state.activityFlag = undefined;//活动生效清零
  507. this.state.status = undefined;//项目状态清零
  508. this.loadData();
  509. },
  510. //新增部分的清零
  511. addReset(){
  512. this.state.categoryName='';//项目名称清零
  513. this.state.ProvinceCity=undefined;
  514. this.state.addCid=undefined;
  515. this.state.boutique='';
  516. },
  517. //更多搜索的显示与否
  518. searchSwitch() {
  519. this.setState({
  520. searchMore: !this.state.searchMore
  521. });
  522. },
  523. render() {
  524. const FormItem = Form.Item
  525. const rowSelection = {
  526. selectedRowKeys: this.state.selectedRowKeys,
  527. onChange: (selectedRowKeys, selectedRows) => {
  528. this.setState({
  529. selectedRows: selectedRows.slice(-1),
  530. selectedRowKeys: selectedRowKeys.slice(-1)
  531. });
  532. }
  533. };
  534. const formItemLayout = {
  535. labelCol: { span: 8 },
  536. wrapperCol: { span: 14 },
  537. };
  538. const hasSelected = this.state.selectedRowKeys.length > 0;
  539. const { RangePicker } = DatePicker;
  540. const categoryList = this.state.categoryList ||[];
  541. const firstData = this.state.firstData || [];
  542. return (
  543. <div className="user-content" >
  544. <div className="content-title">
  545. <div className="user-search">
  546. <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'50px'}}>新增项目<Icon type="plus" /></Button>
  547. <Input placeholder="业务项目名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  548. value={this.state.nameSearch}
  549. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  550. <Select placeholder="业务品类"
  551. style={{ width:'200px',marginRight:'10px' }}
  552. value={this.state.cid}
  553. onChange={(e) => { this.setState({ cid: e }) }} notFoundContent="未获取到上级品类列表">
  554. {
  555. firstData.map(function (item) {
  556. return <Select.Option key={item.id} >{item.name}</Select.Option>
  557. })
  558. }
  559. </Select>
  560. <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
  561. <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
  562. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  563. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  564. disabled={!hasSelected}
  565. >删除<Icon type="minus" />
  566. </Button>
  567. </Popconfirm>
  568. </div>
  569. <div className="patent-table">
  570. <Spin spinning={this.state.loading}>
  571. <Table columns={this.state.columns}
  572. dataSource={this.state.dataSource}
  573. rowSelection={rowSelection}
  574. pagination={this.state.pagination}
  575. onRowClick={this.tableRowClick}
  576. current={this.state.aa}/>
  577. </Spin>
  578. </div>
  579. <div className="patent-desc">
  580. <Modal maskClosable={false} visible={this.state.visible}
  581. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  582. width='400px'
  583. title='新增业务项目'
  584. footer=''
  585. className="admin-desc-content">
  586. <Form layout="horizontal" onSubmit={this.addhandleSubmit} id="demand-form">
  587. <Spin spinning={this.state.loading}>
  588. <div className="clearfix">
  589. <FormItem
  590. labelCol={{ span: 7 }}
  591. wrapperCol={{ span: 12 }}
  592. label="业务项目名称" >
  593. <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
  594. onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
  595. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  596. </FormItem>
  597. </div>
  598. <div className="clearfix">
  599. <FormItem
  600. labelCol={{ span: 7 }}
  601. wrapperCol={{ span: 12 }}
  602. label="业务品类"
  603. >
  604. <Select placeholder="请选择业务品类" value={this.state.addCid} onChange={(e)=>{this.setState({addCid:e})}}
  605. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  606. {
  607. firstData.map(function (item) {
  608. return <Select.Option key={item.id} >{item.name}</Select.Option>
  609. })
  610. }
  611. </Select>
  612. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  613. </FormItem>
  614. </div>
  615. <div className="clearfix">
  616. <FormItem
  617. labelCol={{ span: 7 }}
  618. wrapperCol={{ span: 12 }}
  619. label="省-市"
  620. >
  621. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  622. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  623. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  624. </FormItem>
  625. </div>
  626. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  627. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  628. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'15px'}}>取消</Button>
  629. </FormItem>
  630. </Spin>
  631. </Form >
  632. </Modal>
  633. </div>
  634. <div className="patent-desc">
  635. <Modal
  636. className="customeDetails"
  637. title="业务项目"
  638. width='1000px'
  639. visible={this.state.editvisible}
  640. onOk={this.edithandleCancel}
  641. onCancel={this.edithandleCancel}
  642. footer=''
  643. >
  644. <Form layout="horizontal" onSubmit={this.edithandleSubmit} id="demand-form">
  645. <Spin spinning={this.state.loading}>
  646. <div className="clearfix" style={{paddingLeft:'60px'}}>
  647. <FormItem className="half-item"
  648. labelCol={{ span: 4 }}
  649. wrapperCol={{ span: 12 }}
  650. label={<span><strong style={{color:'red'}}>*</strong>项目名称</span>} >
  651. <Input placeholder="项目名称" value={this.state.name}
  652. onChange={(e)=>{this.setState({name:e.target.value})}}/>
  653. </FormItem>
  654. <FormItem className="half-item"
  655. labelCol={{ span: 4 }}
  656. wrapperCol={{ span: 12 }}
  657. label={<span><strong style={{color:'red'}}>*</strong>业务品类</span>}
  658. >
  659. <Select placeholder="请选择业务品类" value={this.state.categoryId} onChange={(e)=>{this.setState({categoryId:e})}}
  660. notFoundContent="未获取到业务品类列表">
  661. {
  662. firstData.map(function (item) {
  663. return <Select.Option key={item.id} >{item.name}</Select.Option>
  664. })
  665. }
  666. </Select>
  667. </FormItem>
  668. </div>
  669. <div className="clearfix" style={{paddingLeft:'60px'}}>
  670. <FormItem className="half-item"
  671. labelCol={{ span: 4 }}
  672. wrapperCol={{ span: 12 }}
  673. label={<span><strong style={{color:'red'}}>*</strong>省-市</span>}
  674. >
  675. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市"
  676. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  677. </FormItem>
  678. </div>
  679. <div className="clearfix" style={{paddingLeft:'60px'}}>
  680. <FormItem className="half-item"
  681. labelCol={{ span: 4 }}
  682. wrapperCol={{ span: 12 }}
  683. label={<span><strong style={{color:'red'}}>*</strong>市场价</span>}
  684. >
  685. <InputNumber placeholder="市场价" value={this.state.price} style={{width:120}}
  686. onChange={(e)=>{this.setState({price:e})}} required="required"/>
  687. <span style={{marginLeft:10}}>万元</span>
  688. </FormItem>
  689. <FormItem className="half-item"
  690. labelCol={{ span: 4 }}
  691. wrapperCol={{ span: 12 }}
  692. label="活动价"
  693. >
  694. <InputNumber placeholder="活动价" value={this.state.activityPrice} style={{width:120}}
  695. onChange={(e)=>{this.setState({activityPrice:e})}} min={0} max={999999} step={0.01}/>
  696. <span style={{marginLeft:10}}>万元</span>
  697. </FormItem>
  698. <FormItem className="half-item"
  699. labelCol={{ span: 4 }}
  700. wrapperCol={{ span: 12 }}
  701. label="最低折扣"
  702. >
  703. <InputNumber placeholder="最低折扣(如:0.5)" value={this.state.offset} style={{width:'50%'}}
  704. onChange={(e)=>{this.setState({offset:e})}} min={0} max={1} step={0.01}/>
  705. </FormItem>
  706. <FormItem className="half-item"
  707. labelCol={{ span: 4 }}
  708. wrapperCol={{ span: 12 }}
  709. label="会员价"
  710. >
  711. <InputNumber placeholder="会员价" value={this.state.memberPrice} style={{width:'120px'}}
  712. onChange={(e)=>{this.setState({memberPrice:e})}} min={0} max={999999} step={0.01}/>
  713. <span style={{marginLeft:10}}>万元</span>
  714. </FormItem>
  715. <FormItem className="half-item"
  716. labelCol={{ span: 4 }}
  717. wrapperCol={{ span: 12 }}
  718. label="活动生效"
  719. >
  720. <Select placeholder="活动生效" value={this.state.activityFlag} style={{width:'94%'}}
  721. onChange={(e)=>{this.setState({activityFlag:e})}}>
  722. <Select.Option key="0" >无效</Select.Option>
  723. <Select.Option key='1' >有效</Select.Option>
  724. </Select>
  725. </FormItem>
  726. <FormItem className="half-item"
  727. labelCol={{ span: 4 }}
  728. wrapperCol={{ span: 12 }}
  729. label="创建时间"
  730. >
  731. <span style={{width:'94%'}}>{this.state.createTime}</span>
  732. </FormItem>
  733. </div>
  734. <div className="clearfix">
  735. <FormItem
  736. labelCol={{ span: 4 }}
  737. wrapperCol={{ span: 12 }}
  738. label="业务项目服务内容" >
  739. <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.introduce}
  740. onChange={(e) => { this.setState({ introduce: e.target.value }) }}/>
  741. </FormItem>
  742. </div>
  743. <div className="clearfix">
  744. <FormItem
  745. labelCol={{ span: 4 }}
  746. wrapperCol={{ span: 12 }}
  747. label="业务项目价值及作用" >
  748. <Input type="textarea" rows={4} placeholder="业务项目价值及作用" value={this.state.value}
  749. onChange={(e) => { this.setState({ value: e.target.value }) }}/>
  750. </FormItem>
  751. </div>
  752. <div className="clearfix">
  753. <FormItem
  754. labelCol={{ span: 4 }}
  755. wrapperCol={{ span: 12 }}
  756. label="业务项目客户基本条件" >
  757. <Input type="textarea" rows={4} placeholder="业务项目客户基本条件" value={this.state.applyConditions}
  758. onChange={(e) => { this.setState({ applyConditions: e.target.value }) }}/>
  759. </FormItem>
  760. </div>
  761. <div className="clearfix pictures">
  762. <FormItem className="half-item"
  763. labelCol={{ span: 8 }}
  764. wrapperCol={{ span: 10 }}
  765. label="业务项目图标(小)" >
  766. <PicturesWall
  767. pictureSign="business_project_min_picture"
  768. fileList={this.getOrgCodeUrl}
  769. pictureUrl={this.state.orgCodeUrl} />
  770. <p>图片建议:图片要清晰。(35*35)</p>
  771. </FormItem>
  772. <FormItem className="half-item"
  773. labelCol={{ span: 8 }}
  774. wrapperCol={{ span: 12 }}
  775. label="业务项目图标(大)" >
  776. <PicturesWall
  777. pictureSign="business_project_max_picture"
  778. fileList={this.getCompanyLogoUrl}
  779. pictureUrl={this.state.companyLogoUrl} />
  780. <p>图片建议:图片要清晰。(200*200)</p>
  781. </FormItem>
  782. </div>
  783. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'20px'}}>保存</Button>
  784. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px',marginBottom:'20px'}}>取消</Button>
  785. </Spin>
  786. </Form>
  787. </Modal>
  788. </div>
  789. </div>
  790. </div>
  791. );
  792. }
  793. }));
  794. export default BusinessProject;