enteringAudit.jsx 13 KB

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