enteringAuditOne.jsx 12 KB

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