businFollow.jsx 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. import React from 'react';
  2. import {Form,Button,Spin,message,Modal} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import {getCompanyIntention ,getfllowSituation,getcustomerStatue,getContactType} from '@/tools.js';
  6. const FormItem =Form.Item;
  7. const BusinFollow =React.createClass({
  8. getInitialState(){
  9. return {
  10. loading:false
  11. }
  12. },
  13. businessFollowCancel(){
  14. this.setState({
  15. businessFollowModul:false
  16. })
  17. this.props.closeBusiness(false)
  18. },
  19. componentWillReceiveProps(nextProps) {
  20. if(nextProps.businessFollowModul){
  21. this.setState({
  22. businessFollowModul:true
  23. })
  24. this.listFollowUp(nextProps.data);
  25. }
  26. },
  27. listFollowUp(e) {
  28. $.ajax({
  29. method: "get",
  30. dataType: "json",
  31. crossDomain: false,
  32. url: globalConfig.context + "/api/admin/customer/toUpdateFollowOneBusiness",
  33. data: {
  34. ufbId: e.ufbId
  35. },
  36. success: function(data) {
  37. let thedata = data.data;
  38. if(!thedata) {
  39. if(data.error && data.error.length) {
  40. message.warning(data.error[0].message);
  41. };
  42. thedata = {};
  43. };
  44. this.setState({
  45. businessProjectName: thedata.businessProjectName,
  46. followSituations: thedata.followSituation,
  47. customerStatuss: thedata.customerStatus,
  48. followTimes: thedata.followTime,
  49. createTimes: thedata.createTime,
  50. identifyNames: thedata.identifyName,
  51. contactTypes: parseInt(thedata.contactType),
  52. results: thedata.result,
  53. remarkss: thedata.remarks,
  54. adminNames: thedata.adminName,
  55. contactss: thedata.contacts,
  56. contactMobiles: thedata.contactMobile,
  57. ufbId: thedata.ufbId,
  58. followIds: thedata.followId,
  59. });
  60. }.bind(this),
  61. }).always(function() {
  62. this.setState({
  63. loading: false
  64. });
  65. }.bind(this));
  66. },
  67. render(){
  68. const formItemLayout = {
  69. labelCol: { span: 8 },
  70. wrapperCol: { span: 14 },
  71. };
  72. return(
  73. <Modal
  74. footer=''
  75. title="业务跟进详情"
  76. width='600px'
  77. visible={this.state.businessFollowModul}
  78. onOk={this.businessFollowCancel}
  79. onCancel={this.businessFollowCancel}
  80. >
  81. <div className="clearfix">
  82. <Form layout="horizontal" id="demand-form">
  83. <Spin spinning={this.state.loading}>
  84. <div className="clearfix">
  85. <FormItem className="half-item"
  86. {...formItemLayout}
  87. label="意向业务名称" >
  88. <span>{this.state.businessProjectName}</span>
  89. </FormItem>
  90. <FormItem className="half-item"
  91. {...formItemLayout}
  92. label="意向时间" >
  93. <span>{this.state.createTimes}</span>
  94. </FormItem>
  95. <FormItem className="half-item"
  96. {...formItemLayout}
  97. label="客户名称" >
  98. <span>{this.state.identifyNames}</span>
  99. </FormItem>
  100. <FormItem className="half-item"
  101. {...formItemLayout}
  102. label="营销员" >
  103. <span>{this.state.adminNames}</span>
  104. </FormItem>
  105. <FormItem className="half-item"
  106. {...formItemLayout}
  107. label="意向业务进度" >
  108. <span>{getfllowSituation(this.state.followSituations)}</span>
  109. </FormItem>
  110. <FormItem className="half-item"
  111. {...formItemLayout}
  112. label="业务客户状态" >
  113. <span>{getcustomerStatue(this.state.customerStatuss)}</span>
  114. </FormItem>
  115. </div>
  116. <div className="clearfix">
  117. <FormItem className="half-item"
  118. {...formItemLayout}
  119. label="业务意向说明" >
  120. <span>{this.state.remarkss}</span>
  121. </FormItem>
  122. </div>
  123. <div className="clearfix">
  124. <div style={{fontSize:'18px',lineHeight:'30px'}}>拜访情况</div>
  125. <FormItem className="half-item"
  126. {...formItemLayout}
  127. label="拜访方式" >
  128. <span>{getContactType(this.state.contactTypes)}</span>
  129. </FormItem>
  130. <FormItem className="half-item"
  131. {...formItemLayout}
  132. label="联系人" >
  133. <span>{!this.props.data.readOnly?this.state.contactss:'***'}</span>
  134. </FormItem>
  135. <FormItem className="half-item"
  136. {...formItemLayout}
  137. label="联系电话" >
  138. <span>{!this.props.data.readOnly?this.state.contactMobiles:'***'}</span>
  139. </FormItem>
  140. <FormItem className="half-item"
  141. {...formItemLayout}
  142. label="拜访时间" >
  143. <span>{this.state.followTimes}</span>
  144. </FormItem>
  145. <FormItem className="half-item"
  146. {...formItemLayout}
  147. label="拜访人" >
  148. <span>{this.state.adminNames}</span>
  149. </FormItem>
  150. <div className="clearfix">
  151. <FormItem className="half-item"
  152. {...formItemLayout}
  153. label="拜访备注" >
  154. <span>{this.state.results}</span>
  155. </FormItem>
  156. </div>
  157. </div>
  158. </Spin>
  159. </Form>
  160. </div>
  161. </Modal>
  162. )
  163. }
  164. })
  165. export default BusinFollow;