businessCategory.jsx 32 KB

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