buyList.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import "react-quill/dist/quill.bubble.css";
  4. import moment from "moment";
  5. import {
  6. Form,
  7. Icon,
  8. Button,
  9. Input,
  10. Select,
  11. Table,
  12. message,
  13. DatePicker,
  14. Modal,
  15. Upload,
  16. Popconfirm,
  17. Cascader,
  18. InputNumber,
  19. Radio,
  20. Tooltip,
  21. Tabs,
  22. Tag, Checkbox
  23. } from "antd";
  24. import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
  25. import {
  26. getGameState,
  27. splitUrl,
  28. getprovince,
  29. getStatuslist,
  30. getLvl,
  31. beforeUploadFile,
  32. getSecretType,
  33. getBuyAuditType,
  34. placeList,
  35. province,
  36. provinceStatus,
  37. getPicPath
  38. } from "@/tools.js";
  39. const { Option } = Select;
  40. import Img01 from "./image/cgg.jpg";
  41. import Img02 from "./image/ttt.jpg";
  42. import Img03 from "./image/xxxd.jpg";
  43. import Img04 from "./image/bbb.jpg";
  44. import SpinContainer from "../../SpinContainer";
  45. import {companyList, getCompanyName, getCompanyValueArray} from "../../common/configure";
  46. //上传图片组件
  47. const PicturesWall = React.createClass({
  48. getInitialState() {
  49. return {
  50. previewVisible: false,
  51. previewImage: "",
  52. fileList: this.props.pictureUrl,
  53. imgflag: this.props.flagimg
  54. };
  55. },
  56. getDefaultProps() {
  57. return {
  58. changeClick: this.modifyChange
  59. };
  60. },
  61. handleCancel() {
  62. this.setState({ previewVisible: false });
  63. },
  64. handlePreview(file) {
  65. this.setState({
  66. previewImage: file.url || file.thumbUrl,
  67. previewVisible: true
  68. });
  69. },
  70. handleChange(info) {
  71. let fileList = info.fileList;
  72. this.setState({ fileList });
  73. this.props.fileList(fileList);
  74. },
  75. componentWillReceiveProps(nextProps) {
  76. this.state.fileList = nextProps.pictureUrl;
  77. },
  78. render() {
  79. const { previewVisible, previewImage, fileList, flagimg } = this.state;
  80. const uploadButton = (
  81. <div>
  82. <Icon type="plus" />
  83. <div className="ant-upload-text">点击上传</div>
  84. </div>
  85. );
  86. return (
  87. <div style={{ display: "inline-block" }} className={flagimg}>
  88. <Upload
  89. beforeUpload={beforeUploadFile}
  90. action={globalConfig.context + "/api/admin/customerCase/uploadFile"}
  91. data={{ sign: "purchase_picture" }}
  92. listType="picture-card"
  93. fileList={fileList}
  94. onPreview={this.handlePreview}
  95. onChange={this.handleChange}
  96. >
  97. {fileList && fileList.length >= 1 ? null : uploadButton}
  98. </Upload>
  99. <Modal
  100. maskClosable={false}
  101. visible={previewVisible}
  102. footer={null}
  103. onCancel={this.handleCancel}
  104. >
  105. <img alt="" style={{ width: "100%" }} src={previewImage} />
  106. </Modal>
  107. </div>
  108. );
  109. }
  110. });
  111. //主体
  112. const BuyList = Form.create()(
  113. React.createClass({
  114. loadData(pageNo) {
  115. this.state.data = [];
  116. this.setState({
  117. loading: true,
  118. page: pageNo
  119. });
  120. $.ajax({
  121. method: "get",
  122. dataType: "json",
  123. crossDomain: false,
  124. url: globalConfig.context + "/api/admin/customerCase/listCustomerCase",
  125. data: {
  126. pageNo: pageNo || this.state.pagination.current || 1,
  127. pageSize: this.state.pagination.pageSize,
  128. name: this.state.nameSearch,
  129. locationSearch: this.state.locationSearch,
  130. },
  131. success: function(data) {
  132. let theArr = [];
  133. if (!data.data || !data.data.list) {
  134. if (data.error && data.error.length) {
  135. message.warning(data.error[0].message);
  136. }
  137. } else {
  138. for (let i = 0; i < data.data.list.length; i++) {
  139. let thisdata = data.data.list[i];
  140. thisdata.key = i + 1;
  141. theArr.push(thisdata);
  142. }
  143. this.state.pagination.current = data.data.pageNo;
  144. this.state.pagination.total = data.data.totalCount;
  145. }
  146. this.setState({
  147. dataSource: theArr,
  148. pagination: this.state.pagination
  149. });
  150. }.bind(this)
  151. }).always(
  152. function() {
  153. this.setState({
  154. loading: false
  155. });
  156. }.bind(this)
  157. );
  158. },
  159. getInitialState() {
  160. return {
  161. loading: false,
  162. flag: true,
  163. timesArr: [],
  164. totalData: {
  165. mark: false
  166. },
  167. locations:[],
  168. purchaseImg: [],
  169. pagination: {
  170. defaultCurrent: 1,
  171. defaultPageSize: 10,
  172. showQuickJumper: true,
  173. pageSize: 10,
  174. onChange: function(page) {
  175. this.loadData(page);
  176. this.setState({
  177. selectedRowKeys: []
  178. });
  179. }.bind(this),
  180. showTotal: function(total) {
  181. return "共" + total + "条数据";
  182. }
  183. },
  184. //数据类型
  185. columns: [
  186. {
  187. title: "序号",
  188. dataIndex: "key",
  189. key: "key"
  190. },
  191. {
  192. title: "省份",
  193. dataIndex: "province",
  194. key: "province",
  195. render: e => {
  196. let str = "";
  197. provinceStatus.forEach(item => {
  198. if (item.value == e) {
  199. str = item.key;
  200. }
  201. });
  202. return str;
  203. }
  204. },
  205. {
  206. title: "公司名字",
  207. dataIndex: "name",
  208. key: "name"
  209. },
  210. {
  211. title: "是否首页",
  212. dataIndex: "status",
  213. key: "status",
  214. render: s => {
  215. return s ? (
  216. <Tag color="#87d068">是</Tag>
  217. ) : (
  218. <Tag color="#f50">否</Tag>
  219. );
  220. }
  221. },
  222. {
  223. title: "LOGO缩率图",
  224. dataIndex: "pictureUrl",
  225. key: "pictureUrl",
  226. render: url => {
  227. let path = getPicPath(globalConfig.avatarUploadHost, url);
  228. return (
  229. <div style={{ textAlign: "center" }}>
  230. <img src={path} style={{ width: "100px", height: 50 }} />
  231. <Button
  232. className="buttonimg"
  233. style={{ marginLeft: 10 }}
  234. onClick={e => {
  235. e.stopPropagation();
  236. this.maximg(path);
  237. }}
  238. >
  239. 查看大图
  240. </Button>
  241. </div>
  242. );
  243. }
  244. },
  245. {
  246. title: "公司",
  247. dataIndex: "locations",
  248. key: "locations",
  249. width:150,
  250. render: r => {
  251. let text = '';
  252. r && r.map((v,i)=>(
  253. text += (i === 0 ? '':',')+getCompanyName(v)
  254. ))
  255. return(
  256. <Tooltip placement="top" title={text}>
  257. {
  258. r && r.map((v,i)=>(
  259. i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
  260. ))
  261. }
  262. {
  263. r.length > 3 ? '.....' : null
  264. }
  265. </Tooltip>
  266. )
  267. }
  268. },
  269. {
  270. title: "排序",
  271. dataIndex: "sort",
  272. key: "sort"
  273. },
  274. {
  275. title: "操作",
  276. dataIndex: "ads",
  277. key: "ads",
  278. render: (text, record, index) => {
  279. return (
  280. <div>
  281. {
  282. <Button
  283. type="primary"
  284. onClick={event => {
  285. this.stopPropagation(event);
  286. this.edit(record);
  287. }}
  288. >
  289. 编辑
  290. </Button>
  291. }
  292. {
  293. <Popconfirm
  294. okText="确定"
  295. cancelText="取消"
  296. title="您确定删除客户服务信息吗?"
  297. onConfirm={() => {
  298. this.delete(record.id);
  299. }}
  300. >
  301. <Button
  302. type="danger"
  303. style={{ marginLeft: "10px" }}
  304. onClick={event => {
  305. this.stopPropagation(event);
  306. }}
  307. >
  308. 删除
  309. </Button>
  310. </Popconfirm>
  311. }
  312. {
  313. <Button
  314. type="primary"
  315. style={{ marginLeft: "10px" }}
  316. onClick={e => {
  317. e.stopPropagation();
  318. if (record.status) {
  319. this.toTop(record, 0);
  320. } else {
  321. this.toTop(record, 1);
  322. }
  323. }}
  324. >
  325. {record.status ? "从首页撤下" : "推荐至首页"}
  326. </Button>
  327. }
  328. </div>
  329. );
  330. }
  331. }
  332. ],
  333. //数据列表
  334. dataSource: []
  335. };
  336. },
  337. //点击大图
  338. maximg(url) {
  339. this.setState({
  340. imgeditvisible: true,
  341. maximg: url
  342. });
  343. },
  344. componentWillMount() {
  345. this.loadData();
  346. },
  347. detailes(record) {
  348. this.setState({
  349. loading: true
  350. });
  351. $.ajax({
  352. method: "get",
  353. dataType: "json",
  354. crossDomain: false,
  355. url: globalConfig.context + "/api/admin/purchase/details",
  356. data: {
  357. id: record.id
  358. },
  359. success: function(data) {
  360. let theArr = [];
  361. let thisdata = data.data;
  362. if (!data.data || !data.data.list) {
  363. if (data.error && data.error.length) {
  364. message.warning(data.error[0].message);
  365. }
  366. }
  367. this.setState({
  368. purchaseImg: thisdata.purchaseImg
  369. ? splitUrl(
  370. thisdata.purchaseImg,
  371. ",",
  372. globalConfig.avatarUploadHost + "/upload"
  373. )
  374. : []
  375. });
  376. Object.assign(
  377. this.state.totalData,
  378. {
  379. content: thisdata.content,
  380. contacts: thisdata.contacts,
  381. contactsMobile: thisdata.contactsMobile,
  382. orgName: thisdata.orgName
  383. },
  384. this.state.RowData
  385. );
  386. }.bind(this)
  387. }).always(
  388. function() {
  389. this.setState({
  390. loading: false
  391. });
  392. }.bind(this)
  393. );
  394. },
  395. stopPropagation(e) {
  396. e.stopPropagation();
  397. e.nativeEvent.stopImmediatePropagation();
  398. },
  399. //删除按钮
  400. delete(id) {
  401. $.ajax({
  402. method: "post",
  403. dataType: "json",
  404. crossDomain: false,
  405. url:
  406. globalConfig.context + "/api/admin/customerCase/deleteCustomerCase",
  407. data: {
  408. id
  409. },
  410. success: function(data) {
  411. let theArr = [];
  412. if (data.error && data.error.length) {
  413. message.warning(data.error[0].message);
  414. } else {
  415. this.loadData();
  416. }
  417. }.bind(this)
  418. }).always(
  419. function() {
  420. this.setState({
  421. loading: false
  422. });
  423. }.bind(this)
  424. );
  425. },
  426. //项目列表整行点击
  427. tableRowClick(record, index) {
  428. this.state.RowData = record;
  429. this.setState({
  430. editvisible: true
  431. });
  432. this.edit(record);
  433. },
  434. edithandleCancel(e) {
  435. this.setState(
  436. {
  437. editvisible: false
  438. },
  439. () => {
  440. this.addReset();
  441. }
  442. );
  443. this.loadData();
  444. },
  445. search() {
  446. this.loadData();
  447. },
  448. add() {
  449. this.setState({
  450. editvisible: true,
  451. flag: false
  452. });
  453. },
  454. toTop(record, num) {
  455. this.setState({
  456. loading: true
  457. });
  458. $.ajax({
  459. method: "post",
  460. dataType: "json",
  461. crossDomain: false,
  462. url:
  463. globalConfig.context + "/api/admin/customerCase/updateCustomerCase",
  464. data: {
  465. id: record.id,
  466. status: num
  467. },
  468. success: function(data) {
  469. let theArr = [];
  470. if (data.error && data.error.length) {
  471. message.warning(data.error[0].message);
  472. } else {
  473. this.loadData();
  474. }
  475. }.bind(this)
  476. }).always(
  477. function() {
  478. this.setState({
  479. loading: false
  480. });
  481. }.bind(this)
  482. );
  483. },
  484. addNew(flag) {
  485. if(this.state.locations.length === 0){
  486. message.warning('请选择公司')
  487. return;
  488. }
  489. if (this.state.flag) {
  490. $.ajax({
  491. method: "post",
  492. dataType: "json",
  493. crossDomain: false,
  494. url:
  495. globalConfig.context + "/api/admin/customerCase/updateCustomerCase",
  496. data: {
  497. id: this.state.id,
  498. name: this.state.name,
  499. pictureUrl: this.state.pictureUrl
  500. ? this.state.pictureUrl[0].response.data
  501. : undefined,
  502. status: this.state.status ? this.state.status : 0,
  503. releaseStatus: flag,
  504. province: this.state.province,
  505. region: this.state.region,
  506. sort: this.state.sort,
  507. locations:this.state.locations.join(','),
  508. },
  509. success: function(data) {
  510. let theArr = [];
  511. if (data.error && data.error.length) {
  512. message.warning(data.error[0].message);
  513. } else {
  514. this.loadData();
  515. this.cancelAdd();
  516. }
  517. }.bind(this)
  518. }).always(
  519. function() {
  520. this.setState({
  521. loading: false
  522. });
  523. }.bind(this)
  524. );
  525. } else {
  526. $.ajax({
  527. method: "post",
  528. dataType: "json",
  529. crossDomain: false,
  530. url: globalConfig.context + "/api/admin/customerCase/addCustomerCase",
  531. data: {
  532. name: this.state.name,
  533. pictureUrl: this.state.pictureUrl
  534. ? this.state.pictureUrl[0].response.data
  535. : undefined,
  536. status: this.state.status ? this.state.status : 0,
  537. releaseStatus: flag,
  538. province: this.state.province,
  539. region: this.state.region,
  540. sort: this.state.sort,
  541. locations: this.state.locations.join(','),
  542. },
  543. success: function(data) {
  544. let theArr = [];
  545. if (data.error && data.error.length) {
  546. message.warning(data.error[0].message);
  547. } else {
  548. this.loadData();
  549. this.cancelAdd();
  550. }
  551. }.bind(this)
  552. }).always(
  553. function() {
  554. this.setState({
  555. loading: false
  556. });
  557. }.bind(this)
  558. );
  559. }
  560. },
  561. issueNew() {
  562. this.change("releaseStatus", 1, () => {
  563. this.addNew();
  564. });
  565. },
  566. //编辑按钮操作
  567. edit(record) {
  568. this.setState({
  569. flag: true,
  570. editvisible: true
  571. });
  572. this.setState({
  573. loading: true
  574. });
  575. $.ajax({
  576. method: "get",
  577. dataType: "json",
  578. crossDomain: false,
  579. url:
  580. globalConfig.context + "/api/admin/customerCase/selectCustomerCase",
  581. data: {
  582. id: record.id
  583. },
  584. success: function(data) {
  585. let thisdata = data.data;
  586. let str = "";
  587. if (data.error && data.error.length) {
  588. message.warning(data.error[0].message);
  589. }
  590. placeList.forEach(item => {
  591. if (item.value == thisdata.region) {
  592. str = item.place;
  593. }
  594. });
  595. this.setState({
  596. id: thisdata.id,
  597. name: thisdata.name,
  598. pictureUrl: thisdata.pictureUrl
  599. ? splitUrl(
  600. thisdata.pictureUrl,
  601. ",",
  602. globalConfig.avatarUploadHost
  603. )
  604. : [],
  605. status: thisdata.status,
  606. releaseStatus: thisdata.releaseStatus,
  607. province: thisdata.province + "",
  608. region: thisdata.region,
  609. regionStr: str,
  610. locations: thisdata.locations,
  611. checked:thisdata.locations.length === companyList.length,
  612. indeterminate: thisdata.locations.length < companyList.length,
  613. sort: thisdata.sort,
  614. releaseTimeConvert: thisdata.releaseTimeConvert,
  615. createTimeConvert: thisdata.createTimeConvert
  616. });
  617. }.bind(this)
  618. }).always(
  619. function() {
  620. this.setState({
  621. loading: false
  622. });
  623. }.bind(this)
  624. );
  625. },
  626. cancelAdd() {
  627. this.setState(
  628. {
  629. editvisible: false
  630. },
  631. () => {
  632. this.setState({
  633. flag: true
  634. });
  635. this.addReset();
  636. }
  637. );
  638. this.loadData();
  639. },
  640. //新增框的清零
  641. addReset() {
  642. this.setState({
  643. name: undefined,
  644. pictureUrl: undefined,
  645. status: 0,
  646. province: undefined,
  647. region: undefined,
  648. sort: undefined,
  649. regionStr: undefined,
  650. locations: [],
  651. indeterminate: false,
  652. checked:false,
  653. });
  654. },
  655. imghandleCancel() {
  656. this.setState({
  657. imgeditvisible: false
  658. });
  659. },
  660. //搜索部分的清零
  661. reset() {
  662. this.setState({
  663. locationSearch: undefined,
  664. nameSearch: undefined,
  665. },()=>{
  666. this.loadData();
  667. })
  668. },
  669. getOrgCodeUrl(e) {
  670. this.setState({ pictureUrl: e });
  671. },
  672. change(key, e, f) {
  673. if (f === undefined) {
  674. this.state.totalData[key] = e;
  675. this.setState({
  676. totalData: this.state.totalData
  677. });
  678. } else if (typeof f === "function") {
  679. this.state.totalData[key] = e;
  680. this.setState(
  681. {
  682. totalData: this.state.totalData
  683. },
  684. f
  685. );
  686. }
  687. },
  688. render() {
  689. const FormItem = Form.Item;
  690. const rowSelection = {
  691. selectedRowKeys: this.state.selectedRowKeys,
  692. onChange: (selectedRowKeys, selectedRows) => {
  693. this.setState({
  694. selectedRows: selectedRows.slice(-1),
  695. selectedRowKeys: selectedRowKeys.slice(-1)
  696. });
  697. }
  698. };
  699. let data = this.state.totalData;
  700. const { TextArea } = Input; //文本域
  701. const { TabPane } = Tabs; //标签页
  702. const { MonthPicker, RangePicker, WeekPicker } = DatePicker; //日期输入框
  703. return (
  704. <div className="user-content">
  705. <div className="content-title">
  706. <span>服务客户</span>
  707. <div className="user-search">
  708. <Input
  709. placeholder="请输入公司关键字"
  710. style={{
  711. width: "150px",
  712. marginRight: "10px",
  713. marginBottom: "10px"
  714. }}
  715. value={this.state.nameSearch}
  716. onChange={e => {
  717. this.setState({ nameSearch: e.target.value });
  718. }}
  719. />
  720. <Select
  721. placeholder="请选择公司"
  722. style={{ width: 150 }}
  723. value={this.state.locationSearch}
  724. onChange={e => {
  725. this.setState({
  726. locationSearch: e
  727. });
  728. }}
  729. >
  730. {
  731. companyList.map((v)=>(
  732. <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
  733. ))
  734. }
  735. </Select>
  736. <Button
  737. type="primary"
  738. onClick={this.search}
  739. style={{ marginRight: "10px" }}
  740. >
  741. 搜索
  742. </Button>
  743. <Button onClick={this.reset} style={{ marginRight: "10px" }}>
  744. 重置
  745. </Button>
  746. <Button
  747. type="primary"
  748. onClick={this.add}
  749. style={{ marginLeft: "100px" }}
  750. >
  751. 新增客户
  752. </Button>
  753. </div>
  754. <div className="patent-table">
  755. <SpinContainer spinning={this.state.loading}>
  756. <Table
  757. columns={this.state.columns}
  758. dataSource={this.state.dataSource}
  759. pagination={this.state.pagination}
  760. onRowClick={this.tableRowClick}
  761. bordered
  762. size="small"
  763. />
  764. </SpinContainer>
  765. </div>
  766. </div>
  767. <div className="patent-desc">
  768. <Modal
  769. className="customeDetails"
  770. title={this.state.flag ? "客户服务详情" : "新增案例信息"}
  771. width="511px"
  772. visible={this.state.editvisible}
  773. onOk={this.edithandleCancel}
  774. onCancel={
  775. this.state.flag ? this.edithandleCancel : this.cancelAdd
  776. }
  777. footer=""
  778. >
  779. <SpinContainer spinning={this.state.loading}>
  780. <div className="clearfix">
  781. <FormItem
  782. labelCol={{ span: 7 }}
  783. wrapperCol={{ span: 13 }}
  784. label="服务客户名称:"
  785. >
  786. <Input
  787. placeholder="请输入服务客户名称"
  788. value={this.state.name}
  789. onChange={e => {
  790. this.setState({
  791. name: e.target.value
  792. });
  793. }}
  794. style={{ width: "140px" }}
  795. />
  796. </FormItem>
  797. </div>
  798. <div className="clearfix">
  799. <FormItem
  800. labelCol={{ span: 7 }}
  801. wrapperCol={{ span: 13 }}
  802. label="所属省份"
  803. >
  804. <Select
  805. style={{ width: 120 }}
  806. placeholder="请选择省份"
  807. value={this.state.province}
  808. onChange={e => {
  809. this.setState({
  810. province: e
  811. });
  812. let str = "";
  813. provinceStatus.forEach(item => {
  814. if (item.value == e) {
  815. str = item.key;
  816. }
  817. });
  818. placeList.forEach(item => {
  819. item.children.forEach(key => {
  820. if (key == str) {
  821. this.setState({
  822. regionStr: item.place,
  823. region: item.value
  824. });
  825. }
  826. });
  827. });
  828. }}
  829. >
  830. {provinceStatus.map(item => {
  831. return <Option value={item.value}>{item.key}</Option>;
  832. })}
  833. </Select>
  834. </FormItem>
  835. </div>
  836. <div className="clearfix">
  837. <FormItem
  838. labelCol={{ span: 7 }}
  839. wrapperCol={{ span: 13 }}
  840. label="所属区域"
  841. >
  842. <Input
  843. value={this.state.regionStr}
  844. disabled
  845. style={{ width: "140px" }}
  846. />
  847. </FormItem>
  848. </div>
  849. <div className="clearfix">
  850. <FormItem
  851. labelCol={{ span: 7 }}
  852. wrapperCol={{ span: 13 }}
  853. label="公司"
  854. >
  855. <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
  856. this.setState({
  857. locations: e.target.checked ? getCompanyValueArray():[],
  858. indeterminate: false,
  859. checked:e.target.checked
  860. })
  861. }}>全选</Checkbox>
  862. <Checkbox.Group
  863. options={companyList}
  864. value={this.state.locations}
  865. onChange={(e) => {
  866. this.setState({
  867. locations: e,
  868. indeterminate: companyList.length > e.length,
  869. checked: companyList.length === e.length
  870. });
  871. }}
  872. />
  873. </FormItem>
  874. </div>
  875. <div className="clearfix">
  876. <FormItem
  877. labelCol={{ span: 7 }}
  878. wrapperCol={{ span: 13 }}
  879. label="排序"
  880. >
  881. <Input
  882. value={this.state.sort}
  883. placeholder="请输入数字"
  884. onChange={e => {
  885. this.setState({
  886. sort: e.target.value
  887. });
  888. }}
  889. style={{ width: "140px" }}
  890. />
  891. </FormItem>
  892. </div>
  893. <div className="clearfix">
  894. <FormItem
  895. labelCol={{ span: 7 }}
  896. wrapperCol={{ span: 13 }}
  897. label="客户logo"
  898. >
  899. <PicturesWall
  900. flagimg={this.state.flag}
  901. fileList={this.getOrgCodeUrl}
  902. pictureUrl={this.state.pictureUrl}
  903. />
  904. <p>建议尺寸:248X189 图片建议:要清晰。</p>
  905. </FormItem>
  906. </div>
  907. <div className="clearfix">
  908. <Button
  909. type="primary"
  910. size="large"
  911. onClick={e => {
  912. this.addNew(0);
  913. }}
  914. style={{
  915. float: "right",
  916. marginRight: "80px",
  917. marginTop: "20px"
  918. }}
  919. >
  920. 保存
  921. </Button>
  922. <Button
  923. type="primary"
  924. size="large"
  925. onClick={e => {
  926. this.addNew(1);
  927. }}
  928. style={{
  929. float: "right",
  930. marginRight: "20px",
  931. marginTop: "20px"
  932. }}
  933. >
  934. 保存并发布
  935. </Button>
  936. </div>
  937. </SpinContainer>
  938. </Modal>
  939. <Modal
  940. visible={this.state.imgeditvisible}
  941. onCancel={this.imghandleCancel}
  942. onOk={this.imgOk}
  943. >
  944. <img style={{ width: "100%" }} src={this.state.maximg} />
  945. </Modal>
  946. </div>
  947. </div>
  948. );
  949. }
  950. })
  951. );
  952. export default BuyList;