123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- import React from 'react';
- import { Radio, Icon, Button, Cascader, Input, Select, Tabs, Spin, Popconfirm, Table, Switch, message, DatePicker, Modal, Upload, Form, Row, Col } from 'antd';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import moment from 'moment';
- import { citySelect, provinceList, areaSelect } from '../../../areaList';
- import {getProvinceList} from '../../../addressList';
- const { Column, ColumnGroup } = Table;
- const TabPane = Tabs.TabPane;
- const monthFormat = 'YYYY/MM';
- import CustomerDetail from './myClientDesc.jsx';
- import { socialAttribute, industry, auditStatusL, newFollow, lvl, currentMember, statuslist, customerStatus, intentionalService } from '../../../dataDic.js';
- import { getSocialAttribute, splitUrl,getAuditStatus, getCompanyIntention, getStatuslist, getContactType, getIndustryType, getfllowSituation, beforeUploadFile, getWhether, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '../../../tools.js';
- const QueryCustomer = Form.create()(React.createClass({
- loadData(pageNo) {
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/findEnteringAuditIsNo',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- name: this.state.nameSearch,//客户名称
- adminName:this.state.adminName,//营销员名称
- },
- success: function(data) {
- let theArr = [];
- let thisdata;
- if(data.error.length || data.data.list == "") {
- if(data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for(let i = 0; i < data.data.list.length; i++) {
- thisdata = data.data.list[i];
- theArr.push({
- key: i,
- id: thisdata.uid,
- name: thisdata.name,
- createTime: thisdata.createTime,
- adminName: thisdata.adminName,
- contactMobile: thisdata.contactMobile,
- auditOpinion: thisdata.auditOpinion,
- });
- };
- this.state.pagination.current = data.data.pageNo;
- this.state.pagination.total = data.data.totalCount;
- };
- if(data.data&&data.data.list&&!data.data.list.length){
- this.state.pagination.current=0;
- this.state.pagination.total=0;
- }
- this.setState({
- dataSource: theArr,
- pagination: this.state.pagination,
- selectedRowKeys:[]
- });
- }.bind(this),
- }).always(function() {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //点击出现函数
- setModal2VisibleOk(e) {
- this.setState({
- modal2Visible: true
- });
- },
- //点击消失函数
- setModal2Visiblecancel(e) {
- this.setState({
- modal2Visible: false
- });
- },
- getPictureUrl(e) {
- this.setState({ pictureUrl: e });
- },
- handleOk(e) {
- this.setState({
- visible: false,
- });
- },
- handleCancel(e) {
- this.setState({
- visible: false,
- });
- },
- getInitialState() {
- return {
- addressSearch: [],
- orgCodeUrl: [],
- companyLogoUrl: [],
- visible: false,
- searchMore: true,
- releaseDate: [],
- releaseDate: [],
- selectedRowKeys: [],
- selectedRowKey: [],
- selectedRows: [],
- loading: false,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function(page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function(total) {
- return '共' + total + '条数据';
- }
- },
- columns: [{
- title: '客户名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '联系电话',
- dataIndex: 'contactMobile',
- key: 'contactMobile',
- },
- {
- title: '营销员',
- dataIndex: 'adminName',
- key: 'adminName',
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- key: 'createTime',
- },
- {
- title: '拒绝原因',
- dataIndex: 'auditOpinion',
- key: 'auditOpinion',
- }
- ],
- dataSource: [],
- };
- },
- //审核不通过
- examineCancel(record){
- let api=2;
- this.examine(api,record);
- },
- //审核通过
- examineOK(record){
- let api=1;
- this.examine(api,record);
- },
- examine(api,record) {
- this.setState({
- selectedRowKeys: [],
- });
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
- data: {
- id:record.id,
- auditStatus:api,
- auditOpinion:this.state.auditOpinion,
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('操作成功');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- componentWillMount() {
- this.loadData();
- },
- //审核实名认证不通过功能
- auditRows(e) {
- e.preventDefault();
- $.ajax({
- url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
- method: 'post',
- data: {
- id:this.state.id,
- auditOpinion:this.state.auditOpinion,
- auditStatus:2,
- }
- }).done(function(data) {
- this.setState({
- loading: false
- });
- if(!data.error.length) {
- message.success('操作成功!');
- this.detailsModal()
- this.loadData();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- },
- //审核实名认证通过功能
- auditRowse(e) {
- e.preventDefault();
- $.ajax({
- url: globalConfig.context + '/api/admin/customer/updateEnteringAudit',
- method: 'post',
- data: {
- id:this.state.id,
- auditOpinion:this.state.auditOpinion,
- auditStatus:1,
- }
- }).done(function(data) {
- this.setState({
- loading: false
- });
- if(!data.error.length) {
- message.success('操作成功!');
- this.detailsModal()
- this.loadData();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- },
- search() {
- this.loadData();
- },
- reset() {
- this.state.nameSearch = '';
- this.state.adminName=''
- this.loadData();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- //整行点击
- // tableRowClick(record, index) {
- // this.state.RowData = record;
- // this.detailsModalOk(record);
- // this.setState({
- // name:record.name,
- // id:record.id,
- // })
- // },
- detailsModalOk(e) {
- this.setState({
- modal5Visible: true
- }); //需要一个请求数据
- },
- detailsModal(e){
- this.setState({
- modal5Visible: false
- });
- },
- componentWillReceiveProps(nextProps) {
- if(!this.props.visible && nextProps.visible) {
- if(nextProps.data && nextProps.data.id) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- };
- this.state.data = {};
- this.state.companyLogoUrl = [];
- this.state.orgCodeUrl = [];
- this.loadData(null);
- };
- },
- render() {
- const FormItem = Form.Item
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- },
- onSelect: (recordt, selected, selectedRows) => {
- this.setState({
- recordt: recordt.id
- })
- },
- };
- const rowSelections = {
- selectedRowKeys: this.state.selectedRowKey,
- onChange: (selectedRowKey, selectedRow) => {
- this.setState({
- selectedRow: selectedRow.slice(-1),
- selectedRowKey: selectedRowKey.slice(-1)
- });
- },
- onSelect: (records, selected, selectedRow) => {
- this.setState({
- selectedRow: selectedRow.slice(-1),
- records: records.id,
- })
- },
- };
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- //const theDatak = this.state.datak || {};
- const theInformation = this.state.dataInformation || {}
- const contactsOption = "";
- const formItemLayput = {
- labelCol: { span: 10 },
- wrapperCol: { span: 14 },
- };
- const contacts = this.state.contacts || '';
- return(
- <div className="user-content" >
- <div className="content-title">
- <span>个人客户资料审核</span>
- </div>
- <div className="user-search">
- <Input placeholder="客户名称"
- value={this.state.nameSearch}
- onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
- <Input placeholder="营销员"
- value={this.state.adminName}
- onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
- <Button type="primary" onClick={this.search}>搜索</Button>
- <Button onClick={this.reset}>重置</Button>
- </div>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- onRowClick={this.tableRowClick}
- />
- </Spin>
- </div>
- <Modal
- className="customeDetails"
- title="个人客户资料审核"
- width='500px'
- visible={this.state.modal5Visible}
- onOk={this.detailsModal}
- onCancel={this.detailsModal}
- footer=''
- >
- <Form horizontal onSubmit={this.auditRows} id="add-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 15 }}
- label="客户名称" >
- <span>{this.state.name}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 15 }}
- label="审核意见" >
- <Input type="textarea" rows={4} placeholder="审核意见" value={this.state.auditOpinion}
- onChange={(e) => { this.setState({ auditOpinion: e.target.value }) }} style={{width:'95%'}}/>
- </FormItem>
- </div>
- <FormItem wrapperCol={{ span: 25, offset: 4 }}>
- <Button className="set-submit" type="primary" onClick={this.auditRowse}>审核通过</Button>
- <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'30px'}}>审核不通过</Button>
- <Button className="set-submit" type="ghost" onClick={this.detailsModal} style={{marginLeft:'30px'}}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div >
- );
- }
- }));
- export default QueryCustomer;
|