myReject.jsx 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. import React from 'react';
  2. import { Radio, Icon, Button, Cascader, Input, Select, Tabs, Spin, Popconfirm, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col } from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import './myClient.less';
  7. import QueryCustomer from './myRejectOne.jsx';
  8. import { citySelect, provinceList, areaSelect } from '../../../areaList';
  9. import {getProvinceList} from '../../../addressList';
  10. const { Column, ColumnGroup } = Table;
  11. const TabPane = Tabs.TabPane;
  12. const monthFormat = 'YYYY/MM';
  13. import CustomerDetail from './myClientDesc.jsx';
  14. import { socialAttribute, industry, auditStatusL, newFollow, lvl, currentMember, statuslist, customerStatus, intentionalService } from '../../../dataDic.js';
  15. import { getSocialAttribute, splitUrl,getAuditStatus, getCompanyIntention, getStatuslist, getContactType, getIndustryType, getfllowSituation, beforeUploadFile, getWhether, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '../../../tools.js';
  16. const PublicCustomer = Form.create()(React.createClass({
  17. loadData(pageNo) {
  18. this.state.data = [];
  19. this.setState({
  20. loading: true
  21. });
  22. $.ajax({
  23. method: "post",
  24. dataType: "json",
  25. crossDomain: false,
  26. url: globalConfig.context + '/api/admin/customer/findEnteringAuditIsNo',
  27. data: {
  28. pageNo: pageNo || 1,
  29. pageSize: this.state.pagination.pageSize,
  30. name: this.state.nameSearch,//客户名称
  31. adminName:this.state.adminName,//营销员名称
  32. },
  33. success: function(data) {
  34. let theArr = [];
  35. let thisdata;
  36. if(data.error.length || data.data.list == "") {
  37. if(data.error && data.error.length) {
  38. message.warning(data.error[0].message);
  39. };
  40. } else {
  41. for(let i = 0; i < data.data.list.length; i++) {
  42. thisdata = data.data.list[i];
  43. theArr.push({
  44. key: i,
  45. id: thisdata.uid,
  46. name: thisdata.name,
  47. createTime: thisdata.createTime,
  48. adminName: thisdata.adminName,
  49. contactMobile: thisdata.contactMobile,
  50. auditOpinion:thisdata.auditOpinion,
  51. });
  52. };
  53. this.state.pagination.current = data.data.pageNo;
  54. this.state.pagination.total = data.data.totalCount;
  55. };
  56. if(!data.data.list.length){
  57. this.state.pagination.current=0;
  58. this.state.pagination.total=0;
  59. }
  60. this.setState({
  61. dataSource: theArr,
  62. pagination: this.state.pagination,
  63. selectedRowKeys:[]
  64. });
  65. }.bind(this),
  66. }).always(function() {
  67. this.setState({
  68. loading: false
  69. });
  70. }.bind(this));
  71. },
  72. //点击出现函数
  73. setModal2VisibleOk(e) {
  74. this.setState({
  75. modal2Visible: true
  76. });
  77. },
  78. //点击消失函数
  79. setModal2Visiblecancel(e) {
  80. this.setState({
  81. modal2Visible: false
  82. });
  83. },
  84. getPictureUrl(e) {
  85. this.setState({ pictureUrl: e });
  86. },
  87. handleOk(e) {
  88. this.setState({
  89. visible: false,
  90. });
  91. },
  92. handleCancel(e) {
  93. this.setState({
  94. visible: false,
  95. });
  96. },
  97. getInitialState() {
  98. return {
  99. addressSearch: [],
  100. orgCodeUrl: [],
  101. companyLogoUrl: [],
  102. visible: false,
  103. searchMore: true,
  104. releaseDate: [],
  105. releaseDate: [],
  106. selectedRowKeys: [],
  107. selectedRowKey: [],
  108. selectedRows: [],
  109. loading: false,
  110. pagination: {
  111. defaultCurrent: 1,
  112. defaultPageSize: 10,
  113. showQuickJumper: true,
  114. pageSize: 10,
  115. onChange: function(page) {
  116. this.loadData(page);
  117. }.bind(this),
  118. showTotal: function(total) {
  119. return '共' + total + '条数据';
  120. }
  121. },
  122. columns: [{
  123. title: '客户名称',
  124. dataIndex: 'name',
  125. key: 'name',
  126. }, {
  127. title: '联系电话',
  128. dataIndex: 'contactMobile',
  129. key: 'contactMobile',
  130. },
  131. {
  132. title: '营销员',
  133. dataIndex: 'adminName',
  134. key: 'adminName',
  135. },
  136. {
  137. title: '创建时间',
  138. dataIndex: 'createTime',
  139. key: 'createTime',
  140. },
  141. {
  142. title: '拒绝原因',
  143. dataIndex: 'auditOpinion',
  144. key: 'auditOpinion',
  145. }
  146. ],
  147. dataSource: [],
  148. };
  149. },
  150. //审核通过
  151. examineCancel(record){
  152. let api=0;
  153. this.examine(api,record);
  154. },
  155. //审核不通过
  156. examineOK(record){
  157. let api=1;
  158. this.examine(api,record);
  159. },
  160. examine(api,record) {
  161. this.setState({
  162. selectedRowKeys: [],
  163. });
  164. $.ajax({
  165. method: "POST",
  166. dataType: "json",
  167. crossDomain: false,
  168. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  169. data: {
  170. id:record.id,
  171. auditStatus:api,
  172. auditOpinion:this.state.auditOpinion,
  173. }
  174. }).done(function (data) {
  175. if (!data.error.length) {
  176. message.success('操作成功');
  177. this.setState({
  178. loading: false,
  179. });
  180. } else {
  181. message.warning(data.error[0].message);
  182. };
  183. this.loadData();
  184. }.bind(this));
  185. },
  186. componentWillMount() {
  187. this.loadData();
  188. },
  189. //审核实名认证不通过功能
  190. auditRows(e) {
  191. e.preventDefault();
  192. $.ajax({
  193. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  194. method: 'post',
  195. data: {
  196. id:this.state.id,
  197. auditOpinion:this.state.auditOpinion,
  198. auditStatus:2,
  199. }
  200. }).done(function(data) {
  201. this.setState({
  202. loading: false
  203. });
  204. if(!data.error.length) {
  205. message.success('操作成功!');
  206. this.detailsModal()
  207. this.loadData();
  208. } else {
  209. message.warning(data.error[0].message);
  210. }
  211. }.bind(this));
  212. },
  213. //审核实名认证通过功能
  214. auditRowse(e) {
  215. e.preventDefault();
  216. $.ajax({
  217. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  218. method: 'post',
  219. data: {
  220. id:this.state.id,
  221. auditOpinion:this.state.auditOpinion,
  222. auditStatus:1,
  223. }
  224. }).done(function(data) {
  225. this.setState({
  226. loading: false
  227. });
  228. if(!data.error.length) {
  229. message.success('操作成功!');
  230. this.detailsModal()
  231. this.loadData();
  232. } else {
  233. message.warning(data.error[0].message);
  234. }
  235. }.bind(this));
  236. },
  237. search() {
  238. this.loadData();
  239. },
  240. reset() {
  241. this.state.nameSearch = '';
  242. this.state.adminName=''
  243. this.loadData();
  244. },
  245. searchSwitch() {
  246. this.setState({
  247. searchMore: !this.state.searchMore
  248. });
  249. },
  250. //整行点击
  251. tableRowClick(record, index) {
  252. this.state.RowData = record;
  253. this.detailsModalOk(record);
  254. this.setState({
  255. name:record.name,
  256. id:record.id,
  257. })
  258. },
  259. detailsModalOk(e) {
  260. this.setState({
  261. modal5Visible: true
  262. }); //需要一个请求数据
  263. },
  264. detailsModal(e){
  265. this.setState({
  266. modal5Visible: false
  267. });
  268. },
  269. componentWillReceiveProps(nextProps) {
  270. if(!this.props.visible && nextProps.visible) {
  271. if(nextProps.data && nextProps.data.id) {
  272. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  273. };
  274. this.state.data = {};
  275. this.state.companyLogoUrl = [];
  276. this.state.orgCodeUrl = [];
  277. this.loadData(null);
  278. };
  279. },
  280. render() {
  281. const FormItem = Form.Item
  282. const rowSelection = {
  283. selectedRowKeys: this.state.selectedRowKeys,
  284. onChange: (selectedRowKeys, selectedRows) => {
  285. this.setState({
  286. selectedRows: selectedRows.slice(-1),
  287. selectedRowKeys: selectedRowKeys.slice(-1)
  288. });
  289. },
  290. onSelect: (recordt, selected, selectedRows) => {
  291. this.setState({
  292. recordt: recordt.id
  293. })
  294. },
  295. };
  296. const rowSelections = {
  297. selectedRowKeys: this.state.selectedRowKey,
  298. onChange: (selectedRowKey, selectedRow) => {
  299. this.setState({
  300. selectedRow: selectedRow.slice(-1),
  301. selectedRowKey: selectedRowKey.slice(-1)
  302. });
  303. },
  304. onSelect: (records, selected, selectedRow) => {
  305. this.setState({
  306. selectedRow: selectedRow.slice(-1),
  307. records: records.id,
  308. })
  309. },
  310. };
  311. const hasSelected = this.state.selectedRowKeys.length > 0;
  312. const { RangePicker } = DatePicker;
  313. const { getFieldDecorator } = this.props.form;
  314. const formItemLayout = {
  315. labelCol: { span: 8 },
  316. wrapperCol: { span: 14 },
  317. };
  318. //const theDatak = this.state.datak || {};
  319. const theInformation = this.state.dataInformation || {}
  320. const contactsOption = "";
  321. const formItemLayput = {
  322. labelCol: { span: 10 },
  323. wrapperCol: { span: 14 },
  324. };
  325. const contacts = this.state.contacts || '';
  326. return(
  327. <div className="user-content" >
  328. <div className="content-title">
  329. <span>我的被拒绝客户</span>
  330. </div>
  331. <div className="user-search">
  332. <Input placeholder="客户名称"
  333. value={this.state.nameSearch}
  334. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  335. <Input placeholder="营销员"
  336. value={this.state.adminName}
  337. onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
  338. <Button type="primary" onClick={this.search}>搜索</Button>
  339. <Button onClick={this.reset}>重置</Button>
  340. </div>
  341. <div className="patent-table">
  342. <Spin spinning={this.state.loading}>
  343. <Table columns={this.state.columns}
  344. dataSource={this.state.dataSource}
  345. rowSelection={rowSelection}
  346. pagination={this.state.pagination}
  347. onRowClick={this.tableRowClick}
  348. />
  349. </Spin>
  350. </div>
  351. <Modal
  352. className="customeDetails"
  353. title="单位客户资料审核"
  354. width='500px'
  355. visible={this.state.modal5Visible}
  356. onOk={this.detailsModal}
  357. onCancel={this.detailsModal}
  358. footer=''
  359. >
  360. <Form horizontal onSubmit={this.auditRows} id="add-form">
  361. <Spin spinning={this.state.loading}>
  362. <div className="clearfix">
  363. <FormItem
  364. labelCol={{ span: 6 }}
  365. wrapperCol={{ span: 15 }}
  366. label="客户名称" >
  367. <span>{this.state.name}</span>
  368. </FormItem>
  369. </div>
  370. <div className="clearfix">
  371. <FormItem
  372. labelCol={{ span: 6 }}
  373. wrapperCol={{ span: 15 }}
  374. label="审核意见" >
  375. <Input type="textarea" rows={4} placeholder="审核意见" value={this.state.auditOpinion}
  376. onChange={(e) => { this.setState({ auditOpinion: e.target.value }) }} style={{width:'95%'}}/>
  377. </FormItem>
  378. </div>
  379. <FormItem wrapperCol={{ span: 25, offset: 4 }}>
  380. <Button className="set-submit" type="primary" onClick={this.auditRowse}>审核通过</Button>
  381. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'30px'}}>审核不通过</Button>
  382. <Button className="set-submit" type="ghost" onClick={this.detailsModal} style={{marginLeft:'30px'}}>取消</Button>
  383. </FormItem>
  384. </Spin>
  385. </Form >
  386. </Modal>
  387. </div >
  388. );
  389. }
  390. }));
  391. //const Tablees=Form.create()(React.createClass({
  392. // //详情tab切换数据处理
  393. // callbacks(e) {
  394. // this.setState({
  395. // callnubs: e,
  396. // })
  397. // if(e == '1') {
  398. //
  399. // }
  400. // if(e == '2') {
  401. //
  402. // }
  403. //
  404. // },
  405. // getInitialState() {
  406. // return {
  407. // callnubs: "1",
  408. // }
  409. // },
  410. // render() {
  411. // return(
  412. // <div className="clearfix" style={{marginTop:'0px',marginLeft:'20px'}}>
  413. // <Tabs onChange={this.callbacks} type="card" activeKey={this.state.callnubs} style={{paddingLeft:'15px',paddingRight:'15px',marginRight:'20px'}}>
  414. // <TabPane tab="个人客户" key="1" >
  415. // <QueryCustomer />
  416. // </TabPane>
  417. // <TabPane tab="单位客户" key="2">
  418. // <PublicCustomer />
  419. // </TabPane>
  420. // </Tabs>
  421. // </div>
  422. // );
  423. // }
  424. //}));
  425. export default PublicCustomer;