myRejectOne.jsx 12 KB

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