123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- import React from 'react';
- import { Table,Spin, message,Modal } from 'antd';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- const Detail =React.createClass({
- loadData(data,apiUrl) {
- console.log(data)
- this.setState({
- loading: true,
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- //url: globalConfig.context + apiUrl,
- url: globalConfig.context + '/api/admin/customer/toAddFollow',
- data: {
- uid: data.id,
- },
- success: function(data) {
- let listArr = [];
- let thedata = data.data;
- if(!thedata) {
- if(data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- for(let i = 0; i < data.data.userBusinessList.length; i++) {
- let thisdata = data.data.userBusinessList[i];
- listArr.push({
- id: thisdata.id,
- businessName:thisdata.businessName,
- businessGlossoryId: String(thisdata.businessGlossoryId),
- followSituation: String(thisdata.followSituation),
- customerStatus: String(thisdata.customerStatus),
- remarks: thisdata.remarks,
- });
- };
- this.setState({
- dataSource: listArr,
- });
- }.bind(this),
- }).always(function() {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- getInitialState(){
- return{
- loading:false,
- dataSource:[],
- columns: [{
- title: '业务名称',
- dataIndex: 'businessName',
- key: 'businessName',
- }, {
- title: '项目名称',
- dataIndex: 'locationProvince',
- key: 'locationProvince',
- },{
- title: '签单时间',
- dataIndex: 'createTime',
- key: 'createTime',
- },
- {
- title: '客户名称',
- dataIndex: 'contacts',
- key: 'contacts',
- },
- {
- title: '营销员',
- dataIndex: 'contactst',
- key: 'contactst',
- }
- ],
- }
- },
- visitCancel(){
- this.setState({
- visitModul:false
- })
- this.props.closeDesc(false)
- },
- componentWillReceiveProps(nextProps) {
- if(nextProps.visitModul){
- this.setState({
- visitModul:true
- })
- this.loadData(nextProps.data,nextProps.detailApi)
- }
- },
- render(){
- return(
- <Modal
- className="customeDetails"
- footer=''
- title="已签业务"
- width='800px'
- visible={this.state.visitModul}
- onOk={this.visitCancel}
- onCancel={this.visitCancel}
- >
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- pagination={false}
- />
- </Spin>
- </Modal>
- )
- }
- })
- export default Detail;
|