enteringAudit.jsx 14 KB

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