import React from 'react';
import {Form,Button,Spin,message,Table,Popconfirm} from 'antd';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import {getContactType} from '@/tools.js';
import VisitDetail from './visitDetail.jsx';
const Visit = React.createClass({
	getInitialState(){
		return{
			visitArrList:[],
			loading:false,
			visitModul:false,
			paginations: {
				defaultCurrent: 1,
				defaultPageSize: 10,
				showQuickJumper: true,
				pageSize: 10,
				onChange: function(page) {
					this.loadVisit(page);
				}.bind(this),
				showTotal: function(total) {
					return '共' + total + '条数据';
				}
			},
			visitsList: [{
				title: '跟进时间',
				dataIndex: 'followTime',
				key: 'followTime'
			}, {
				title: '客户名称',
				dataIndex: 'identifyName',
				key: 'identifyName'
			}, {
				title: '跟进方式',
				dataIndex: 'contactType',
				key: 'contactType',
				render: text => { return getContactType(text) }
			}, {
				title: '联系人',
				dataIndex: 'contacts',
				key: 'contacts',
				render:(text,record)=>{
					return  
{record.readOnly?
								***:
								{text}}
							
				}
			}, {
				title: '联系电话',
				dataIndex: 'contactMobile',
				key: 'contactMobile',
				render:(text,record)=>{
					return  {record.readOnly?
								***:
								{text}}
							
				}
			}, {
				title: '跟进人',
				dataIndex: 'adminName',
				key: 'adminName'
			}, {
				title: '跟进说明',
				dataIndex: 'result',
				key: 'result'
			}, {
				title: '操作',
				dataIndex: 'ttt',
				key: 'ttt',
				render: (text, record, index) => {
					return 
                            {!record.readOnly&&
{this.visitDelet(record)}} okText="删除" cancelText="不删除">
							    
							}