enteringAudit.jsx 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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. ispage:pageNo,
  22. });
  23. $.ajax({
  24. method: "post",
  25. dataType: "json",
  26. crossDomain: false,
  27. url: globalConfig.context + '/api/admin/customer/findEnteringAudit',
  28. data: {
  29. pageNo: pageNo || 1,
  30. pageSize: this.state.pagination.pageSize,
  31. name: this.state.nameSearch,//客户名称
  32. adminName:this.state.adminName,//营销员名称
  33. },
  34. success: function(data) {
  35. let theArr = [];
  36. let thisdata;
  37. if(data.error.length || data.data.list == "") {
  38. if(data.error && data.error.length) {
  39. message.warning(data.error[0].message);
  40. };
  41. } else {
  42. for(let i = 0; i < data.data.list.length; i++) {
  43. thisdata = data.data.list[i];
  44. theArr.push({
  45. key: i,
  46. id: thisdata.uid,
  47. name: thisdata.name,
  48. createTime: thisdata.createTime,
  49. adminName: thisdata.adminName,
  50. contactMobile: thisdata.contactMobile,
  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. title: '审核操作',
  142. dataIndex: 'ee',
  143. key: 'ee',
  144. render: (text, record, index) => {
  145. return <div>
  146. <Popconfirm title={'请确认通过【'+record.name+'】'} onConfirm={(e)=>{this.examineOK(record)}} okText="确认" cancelText="取消">
  147. <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="primary">通过</Button>
  148. </Popconfirm>
  149. </div>
  150. }
  151. }
  152. ],
  153. dataSource: [],
  154. };
  155. },
  156. //审核通过
  157. examineCancel(record){
  158. let api=0;
  159. this.examine(api,record);
  160. },
  161. //审核不通过
  162. examineOK(record){
  163. let api=1;
  164. this.examine(api,record);
  165. },
  166. examine(api,record) {
  167. this.setState({
  168. selectedRowKeys: [],
  169. });
  170. $.ajax({
  171. method: "POST",
  172. dataType: "json",
  173. crossDomain: false,
  174. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  175. data: {
  176. id:record.id,
  177. auditStatus:api,
  178. auditOpinion:this.state.auditOpinion,
  179. }
  180. }).done(function (data) {
  181. if (!data.error.length) {
  182. message.success('操作成功');
  183. this.setState({
  184. loading: false,
  185. });
  186. } else {
  187. message.warning(data.error[0].message);
  188. };
  189. this.loadData(this.state.ispage);
  190. }.bind(this));
  191. },
  192. componentWillMount() {
  193. this.loadData();
  194. },
  195. //审核实名认证不通过功能
  196. auditRows(e) {
  197. e.preventDefault();
  198. $.ajax({
  199. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  200. method: 'post',
  201. data: {
  202. id:this.state.id,
  203. auditOpinion:this.state.auditOpinion,
  204. auditStatus:2,
  205. }
  206. }).done(function(data) {
  207. this.setState({
  208. loading: false
  209. });
  210. if(!data.error.length) {
  211. message.success('操作成功!');
  212. this.detailsModal()
  213. this.loadData(this.state.ispage);
  214. } else {
  215. message.warning(data.error[0].message);
  216. }
  217. }.bind(this));
  218. },
  219. //审核实名认证通过功能
  220. auditRowse(e) {
  221. e.preventDefault();
  222. $.ajax({
  223. url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
  224. method: 'post',
  225. data: {
  226. id:this.state.id,
  227. auditOpinion:this.state.auditOpinion,
  228. auditStatus:1,
  229. }
  230. }).done(function(data) {
  231. this.setState({
  232. loading: false
  233. });
  234. if(!data.error.length) {
  235. message.success('操作成功!');
  236. this.detailsModal()
  237. this.loadData(this.state.ispage);
  238. } else {
  239. message.warning(data.error[0].message);
  240. }
  241. }.bind(this));
  242. },
  243. search() {
  244. this.loadData();
  245. },
  246. reset() {
  247. this.state.nameSearch = '';
  248. this.state.adminName=''
  249. this.loadData();
  250. },
  251. searchSwitch() {
  252. this.setState({
  253. searchMore: !this.state.searchMore
  254. });
  255. },
  256. //整行点击
  257. tableRowClick(record, index) {
  258. this.state.RowData = record;
  259. this.detailsModalOk(record);
  260. this.setState({
  261. name:record.name,
  262. id:record.id,
  263. })
  264. },
  265. detailsModalOk(e) {
  266. this.setState({
  267. modal5Visible: true
  268. }); //需要一个请求数据
  269. },
  270. detailsModal(e){
  271. this.setState({
  272. modal5Visible: false
  273. });
  274. },
  275. componentWillReceiveProps(nextProps) {
  276. if(!this.props.visible && nextProps.visible) {
  277. if(nextProps.data && nextProps.data.id) {
  278. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  279. };
  280. this.state.data = {};
  281. this.state.companyLogoUrl = [];
  282. this.state.orgCodeUrl = [];
  283. this.loadData(null);
  284. };
  285. },
  286. render() {
  287. const FormItem = Form.Item
  288. const rowSelection = {
  289. selectedRowKeys: this.state.selectedRowKeys,
  290. onChange: (selectedRowKeys, selectedRows) => {
  291. this.setState({
  292. selectedRows: selectedRows.slice(-1),
  293. selectedRowKeys: selectedRowKeys.slice(-1)
  294. });
  295. },
  296. onSelect: (recordt, selected, selectedRows) => {
  297. this.setState({
  298. recordt: recordt.id
  299. })
  300. },
  301. };
  302. const rowSelections = {
  303. selectedRowKeys: this.state.selectedRowKey,
  304. onChange: (selectedRowKey, selectedRow) => {
  305. this.setState({
  306. selectedRow: selectedRow.slice(-1),
  307. selectedRowKey: selectedRowKey.slice(-1)
  308. });
  309. },
  310. onSelect: (records, selected, selectedRow) => {
  311. this.setState({
  312. selectedRow: selectedRow.slice(-1),
  313. records: records.id,
  314. })
  315. },
  316. };
  317. const hasSelected = this.state.selectedRowKeys.length > 0;
  318. const { RangePicker } = DatePicker;
  319. const { getFieldDecorator } = this.props.form;
  320. const formItemLayout = {
  321. labelCol: { span: 8 },
  322. wrapperCol: { span: 14 },
  323. };
  324. //const theDatak = this.state.datak || {};
  325. const theInformation = this.state.dataInformation || {}
  326. const contactsOption = "";
  327. const formItemLayput = {
  328. labelCol: { span: 10 },
  329. wrapperCol: { span: 14 },
  330. };
  331. const contacts = this.state.contacts || '';
  332. return(
  333. <div className="user-content" >
  334. <div className="content-title">
  335. <span>客户资料审核</span>
  336. </div>
  337. <div className="user-search">
  338. <Input placeholder="客户名称"
  339. value={this.state.nameSearch}
  340. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  341. <Input placeholder="营销员"
  342. value={this.state.adminName}
  343. onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
  344. <Button type="primary" onClick={this.search}>搜索</Button>
  345. <Button onClick={this.reset}>重置</Button>
  346. </div>
  347. <div className="patent-table">
  348. <Spin spinning={this.state.loading}>
  349. <Table columns={this.state.columns}
  350. dataSource={this.state.dataSource}
  351. rowSelection={rowSelection}
  352. pagination={this.state.pagination}
  353. onRowClick={this.tableRowClick}
  354. />
  355. </Spin>
  356. </div>
  357. <Modal
  358. className="customeDetails"
  359. title="客户资料审核"
  360. width='500px'
  361. visible={this.state.modal5Visible}
  362. onOk={this.detailsModal}
  363. onCancel={this.detailsModal}
  364. footer=''
  365. >
  366. <Form horizontal onSubmit={this.auditRows} id="add-form">
  367. <Spin spinning={this.state.loading}>
  368. <div className="clearfix">
  369. <FormItem
  370. labelCol={{ span: 6 }}
  371. wrapperCol={{ span: 15 }}
  372. label="客户名称" >
  373. <span>{this.state.name}</span>
  374. </FormItem>
  375. </div>
  376. <div className="clearfix">
  377. <FormItem
  378. labelCol={{ span: 6 }}
  379. wrapperCol={{ span: 15 }}
  380. label="审核意见" >
  381. <Input type="textarea" rows={4} placeholder="审核意见" value={this.state.auditOpinion}
  382. onChange={(e) => { this.setState({ auditOpinion: e.target.value }) }} style={{width:'95%'}}/>
  383. </FormItem>
  384. </div>
  385. <FormItem wrapperCol={{ span: 25, offset: 4 }}>
  386. <Button className="set-submit" type="primary" onClick={this.auditRowse}>审核通过</Button>
  387. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'30px'}}>审核不通过</Button>
  388. <Button className="set-submit" type="ghost" onClick={this.detailsModal} style={{marginLeft:'30px'}}>取消</Button>
  389. </FormItem>
  390. </Spin>
  391. </Form >
  392. </Modal>
  393. </div >
  394. );
  395. }
  396. }));
  397. //const Tablees=Form.create()(React.createClass({
  398. // //详情tab切换数据处理
  399. // callbacks(e) {
  400. // this.setState({
  401. // callnubs: e,
  402. // })
  403. // if(e == '1') {
  404. //
  405. // }
  406. // if(e == '2') {
  407. //
  408. // }
  409. //
  410. // },
  411. // getInitialState() {
  412. // return {
  413. // callnubs: "1",
  414. // }
  415. // },
  416. // render() {
  417. // return(
  418. // <div className="clearfix" style={{marginTop:'0px',marginLeft:'20px'}}>
  419. // <Tabs onChange={this.callbacks} type="card" activeKey={this.state.callnubs} style={{paddingLeft:'15px',paddingRight:'15px',marginRight:'20px'}}>
  420. // <TabPane tab="个人客户" key="1" >
  421. // <QueryCustomer />
  422. // </TabPane>
  423. // <TabPane tab="单位客户" key="2">
  424. // <PublicCustomer />
  425. // </TabPane>
  426. // </Tabs>
  427. // </div>
  428. // );
  429. // }
  430. //}));
  431. export default PublicCustomer;